我是 Akka 的新手,并且遇到了这个问题。
我有 4 个演员,但不知何故,广播消息总是发给一个演员
这是一个示例代码
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"))
请帮忙