- akka.actor.deployment {
- /statsService/workerRouter {
- router = consistent-hashing-group
- routees.paths = ["/user/statsWorker"]
- cluster {
- enabled = on
- allow-local-routees = false
- use-role = compute
- }
- }
- }
- 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
}
system.actorSelection("/user/statsWorker")
- akka.actor.deployment {
- /statsService/singleton/workerRouter {
- router = consistent-hashing-pool
- cluster {
- enabled = on
- max-nr-of-instances-per-node = 3
- allow-local-routees = false
- use-role = compute
- }
- }
- }
- system.actorOf(ClusterSingletonManager.props(
- singletonProps = Props[StatsService],
- terminationMessage = PoisonPill,
- settings = ClusterSingletonManagerSettings(system).withRole("compute")),
- name = "statsService")
- system.actorOf(ClusterSingletonProxy.props(singletonManagerPath = "/user/statsService",
- settings = ClusterSingletonProxySettings(system).withRole("compute")),
- 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
}
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
- akka.actor.deployment {
- /statsService/workerRouter {
- router = consistent-hashing-group
- routees.paths = ["/user/statsWorker"]
- cluster {
- enabled = on
- allow-local-routees = false
- use-role = compute
- }
- }
- }
- 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
--
>>>>>>>>>> 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+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
Patrik Nordwall
Typesafe - Reactive apps on the JVM
Twitter: @patriknw