Hi Björn,

On 15 May 2014 at 23:21:26, Björn Häuser ([email protected]) wrote:

Hello Akka Users!

I am currently trying to build an Akka Cluster based on Playframework 2.2. 

The Idea I am having is to have an OrderActorSupervisor per Node and 
OrderActors for every Order, which are created just once per Cluster. 

This is the code I currently have: 
https://gist.github.com/bjoernhaeuser/e3ebc59b33cc3f713a5e
The config: https://gist.github.com/bjoernhaeuser/da75e14d5fcc5513ddbf

What I *thought* is that "context.actorSelection(..)" always gives me the same 
Actor in the complete cluster, but currently every node creates their own 
OrderActor.

I think I have a fundamental misunderstanding or completly wrong configuration 
of/for my cluster.


So there are no clustered actor paths or selections in the sense that you can 
use the same path and get to a single instance inside the cluster. The akka 
cluster is about node membership and not about actor state replication. If one 
cluster node goes down, then all the actors on that node will die.

Actor state persistence/replication is handled by the akka-persistence module 
in akka 2.3.

One solution to having every node create the OrderActor is to use some 
consistent hashing of the uuid to decide on which node a certain OrderActor 
should be created/looked up.

In akka 2.2 you have the DistributedPubSubMediator that you can use to register 
actors and send messages to registered paths/topics, but you would still need 
to decide yourself on where to place the OrderActors.

There is Distributed workers with Akka and Scala Activator template with sample 
code and a tutorial that shows how to use the DistributedPubSubMediator.

When Play 2.3 is released, and you can use akka 2.3, then you can move to using 
the ClusterSharding extension that can probably do what you are trying to build.

B/


Thanks for helping me
Björn


--
>>>>>>>>>> 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.
-- 
Björn Antonsson
Typesafe – Reactive Apps on the JVM
twitter: @bantonsson

JOIN US. REGISTER TODAY!
Scala
Days
June 16th-18th,
Berlin

-- 
>>>>>>>>>>      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