I need to determine if the sender of the message was one of the local or remote members of the Akka cluster. Currently, the only way I have found for this is
def isLocal(sndr: ActorRef) = sndr.path.address.toString == context.system.toString
What is the best way?
I am using Akka 2.3
Update:
To explain why I want to do this, in case there is a way to completely avoid the problem.
In each node, the router manages multiple participants to do the work. Actor workers send the results back to the local master actor and new assignments are assigned through the sender’s link. Master actors also periodically send results to leading actors of other nodes, ensuring that data is randomly “mixed” between masters on different nodes. In the case of data coming from a remote participant, the master recipient should not try to allocate a new job. This is essentially an implementation of the island mixing method.
source
share