You should not have to use addresses for cluster routers. Take a look at
http://doc.akka.io/docs/akka/2.4.6/java/cluster-usage.html#Cluster_Aware_Routers

/Patrik
ons 18 maj 2016 kl. 15:07 skrev ashish bhutani <bhutani.ashis...@gmail.com>:

> Hi Group
> I have asked a question on Stack overflow. Link:
> http://stackoverflow.com/questions/37271858/how-are-remote-actors-created-on-joining-of-new-nodes-in-akka
> .
> I am just posting here as well to increase my chance of getting help.
> Thanks.
>
> Question:
>
> Explaining my Akka cluster setup:
>
>    - I have remote actors in a multi node Akka cluster.
>    - Actors are behind Router which is of Singleton Type.
>    - Singleton Router is behind a Cluster Singleton Proxy.
>    - Also, on a side note, I have N type of actors, each doing a
>    different kind of task and managed by a different Router.
>
> Code snippet(Java)
>
>
>
> 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");
>
>
>
>
> My doubt is regarding how make the list of Address a dynamic one? The
> current hardcoded list of Address won't work in production.
>
>
> 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)
>
> As far as my seed nodes are concerned, they are mentioned in the akka.conf
> file.
>
>
> akka {
>   actor {
>     provider = "akka.cluster.ClusterActorRefProvider"
>   }
>
>   cluster {
>     seed-nodes = [
>       "akka.tcp://CalcSystem@127.0.0.1:2551"]
>   }}
>
>
>
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to