【发布时间】:2015-11-25 11:24:49
【问题描述】:
如何在 Akka 集群中获取对领导者的引用,以便向领导者节点发送消息?
在代码中:
// assume there exists /user/Supervisor actor at the leader node
val leader = { code to get the leader ref }
leader ! SomeMessage
【问题讨论】:
-
context.actorSelection("akka.tcp://SysName@localhost:port/user/Supervisor").resolveOne?? -
@johny 那行不通。因为领导节点的地址(SysName@localhost:port)未知。
标签: scala akka akka-cluster