def main()

in integration-test/kubernetes-dns/src/main/scala/org/apache/pekko/cluster/bootstrap/ClusterApp.scala [29:65]


  def main(args: Array[String]): Unit = {

    implicit val system: ActorSystem = ActorSystem()
    val cluster = Cluster(system)

    system.log.info("Starting Pekko Management")
    PekkoManagement(system).start()
    ClusterBootstrap(system).start()

    system.actorOf(
      ClusterSingletonManager.props(
        Props[NoisySingleton](),
        PoisonPill,
        ClusterSingletonManagerSettings(system)))
    Cluster(system).subscribe(
      system.actorOf(Props[ClusterWatcher]()),
      ClusterEvent.InitialStateAsEvents,
      classOf[ClusterDomainEvent])

    // add real app routes here
    val routes =
      path("hello") {
        get {
          complete(
            HttpEntity(ContentTypes.`text/html(UTF-8)`, "<h1>Hello</h1>"))
        }
      }

    Http().newServerAt("0.0.0.0", 8080).bind(routes)

    system.log.info(
      s"Server online at http://localhost:8080/\nPress RETURN to stop...")

    cluster.registerOnMemberUp(() => {
      system.log.info("Cluster member is up!")
    })
  }