I am looking at the example given by akka (
http://doc.akka.io/docs/akka/snapshot/scala/cluster-usage.html#Cluster_Aware_Routers
)

I have a 1 question for each group and pool router on how it routes its 
messages.  It is in regards to how messages are passed from router to 
routee.

*Group router*


   1. akka.actor.deployment {
   2.   /statsService/workerRouter {
   3.       router = consistent-hashing-group
   4.       routees.paths = ["/user/statsWorker"]
   5.       cluster {
   6.         enabled = on
   7.         allow-local-routees = false
   8.         use-role = compute
   9.       }
   10.     }
   11. }


- class StatsService extends Actor {
-   // This router is used both with lookup and deploy of routees. If you
-   // have a router with only lookup of routees you can use Props.empty
-   // instead of Props[StatsWorker.class].
-   val workerRouter = context.actorOf(FromConfig.props(Props.empty),
-     name = "workerRouter") 
  
  ...etc
}


Question:

If I have this configuration and this class on a master node.  Is it saying 
that within the actor with name "*statsService*", this is a child actor 
with name "workerRouter".  And the router should direct messages to all 
nodes that use the role *cluster* and select the routee 

system.actorSelection("/user/statsWorker")


*System here would be the each node's local actor system





*Pool router*


   1. akka.actor.deployment {
   2.   /statsService/singleton/workerRouter {
   3.       router = consistent-hashing-pool
   4.       cluster {
   5.         enabled = on
   6.         max-nr-of-instances-per-node = 3
   7.         allow-local-routees = false
   8.         use-role = compute
   9.       }
   10.     }
   11. }



   1. system.actorOf(ClusterSingletonManager.props(
   2.   singletonProps = Props[StatsService],
   3.   terminationMessage = PoisonPill,
   4.   settings = ClusterSingletonManagerSettings(system).withRole("compute")),
   5.   name = "statsService")



   1. system.actorOf(ClusterSingletonProxy.props(singletonManagerPath = 
"/user/statsService",
   2.   settings = ClusterSingletonProxySettings(system).withRole("compute")),
   3.   name = "statsServiceProxy")


- class StatsService extends Actor {
-   // This router is used both with lookup and deploy of routees. If you
-   // have a router with only lookup of routees you can use Props.empty
-   // instead of Props[StatsWorker.class].
-   val workerRouter = context.actorOf(FromConfig.props(Props[StatsWorker]),
-     name = "workerRouter") 
  
  ...etc
}



Question: 

Pool routers are a little different in that it doesn't have *routees.path.  
*A *StatsService* singleton is created on each node with the role *compute*
*.*  Where are the routees in this case?  Are they also created on all 
these nodes such that when I send a message to the singleton proxy, it is 
sending a message to *StatsWorker *on all the nodes with role *compute*?

-- 
>>>>>>>>>>      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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to