title: How are remote actors created on joining of new nodes in akka?
body: <p>Explaining my Akka cluster setup:</p>
  
  <ul>
  <li>I have remote actors in a multi node Akka cluster.</li>
  <li>Actors are behind Router which is of Singleton Type.</li>
  <li>Singleton Router is behind a Cluster Singleton Proxy.</li>
  <li>Also, on a side note, I have N type of actors, each doing a different kind of task and managed by a different Router.</li>
  </ul>
  
  <p>Code snippet(Java)</p>
  
  <pre><code>Config config = ConfigFactory.parseString(
                  "akka.remote.netty.tcp.port=" + 2551).withFallback(
                  ConfigFactory.load());
  
  ActorSystem system = ActorSystem.create("CalcSystem", config);
  
  Address[] addresses = {
                            AddressFromURIString.parse("akka.tcp://CalcSystem@127.0.0.1:2551"),
                            AddressFromURIString.parse("akka.tcp://CalcSystem@127.0.0.1:2552"),
                            AddressFromURIString.parse("akka.tcp://CalcSystem@127.0.0.1:2553")
                            };
          ActorRef router = system.actorOf(
                              ClusterSingletonManager.props(new ClusterRouterPool(new RoundRobinPool(2),
                                      new ClusterRouterPoolSettings(100, 3,
                                              false, "")).props(
                                                      new RemoteRouterConfig(new RoundRobinPool(6), addresses).props(
                                                              Worker.createWorker())),PoisonPill.getInstance(),settings),"workerRouter");
  
      ClusterSingletonProxySettings proxySettings = ClusterSingletonProxySettings.create(system);
      ActorRef routerProxy = system.actorOf(ClusterSingletonProxy.props("/user/workerRouter", proxySettings), "routerProxy");
  </code></pre>
  
  <p>My doubt is regarding how make the list of Address a dynamic one? The current hardcoded list of Address won't work in production.</p>
  
  <p>As soon as new nodes join in the cluster, Routers/ClusterSingletonManager should be able to recognize that and create remote actors on that new node(It could be a brand new node added to an already existing cluster or it could be the case of whole cluster booting up, for the very first time or in the case of new code deployments)</p>
  
  <p>As far as my seed nodes are concerned, they are mentioned in the akka.conf file.</p>
  
  <pre><code>akka {
    actor {
      provider = "akka.cluster.ClusterActorRefProvider"
    }
  
    cluster {
      seed-nodes = [
        "akka.tcp://CalcSystem@127.0.0.1:2551"]
    }
  }
  </code></pre>