I am new to Akka and stuck with this issue.
I have 4 actors but Somehow the broadcast message is always going to one actor
here is a sample code
def hashMapping: ConsistentHashMapping = {
case ReduceNameTitlePair(name,title) => {
//println(s"\n *** Using ${name} as the key")
name
}
}
var actorReduceRouter = context.actorOf(RemoteRouterConfig(ConsistentHashingPool(numReducers,hashMapping = hashMapping), addresses).props(Props(classOf[ReduceActor])))
actorReduceRouter ! Broadcast("SEND ME YOUR DATA"))
Please help
In Classic Actors you can use
Broadcastto send a message to all actors in a router, includingConsistentHashingRouter. When I run the below code I get the message received on all three actors.You appear to be using Broadcast above, so I'm suspicious of your remoting configuration. But since you don't really post anything about your remoting setup here there's not much I can do to troubleshoot. I'd recommend using cluster-aware routers over manual remoting, but I don't know if that is in any way related to your problem.