Hi, I am new to akka. I have posted the question on stackoverflow:
This relates to Create actor on any unspecified/random node in cluster <http://stackoverflow.com/questions/22802740/create-actor-on-any-unspecified-random-node-in-cluster> . I am new to akka. I looking at using akka 2.3.12 but could use latest 2.4 milestone. I would like to achieve the following: - Create an actor (transparently) on a node with the least load in the cluster - The actor has dependencies to a number of services - The actor is created on demand, i.e. I don't want to create x number of actors on start-up. - Any node can create an actor - More than one actor can be created on a node As far as I found out I need to create an adaptive (pool) cluster aware router on each node. I am not sure what the config would look like. The documentation is somewhat confusing. Is the following correct or on the right track? 1) akka.actor.deployment { /myService/myRouter { router = adaptive metrics-selector = mix cluster { enabled = on max-nr-of-instances-per-node = 1 allow-local-routees = on } } } or 2) akka.actor.deployment { /myService/myRouter = { router = adaptive metrics-selector = mix routees.paths = ["/user/worker”] cluster { enabled = on allow-local-routees = on } } } or 3 (combination of 1 & 2): akka.actor.deployment { /myService/myRouter = { router = adaptive metrics-selector = mix routees.paths = ["/user/worker”] cluster { enabled = on allow-local-routees = on max-nr-of-instances-per-node = 1 } } } Would a cluster config - similar to 1-3 - be enough to achieve above outlined goals? Does *max-nr-of-instances-per-node* refer to the number of routers on each node or the number of workers to be created on each node? In regards to actor deployment and its dependencies - Is the actor instantiated on one node and then deployed to a target node or is the actor instantiated on the target node? - If the former is the case then the dependency injecting services is not correct. Should those services really be actors that are created on each node instead? - What does this mean for supervision? Is the actor's supervisor local or remote? I hope the information provided is clear. Any pointers are very much appreciated. Thank you. -- >>>>>>>>>> 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.
