我已经设置了一个 Akka.Net 节点作为集群中的种子节点,我称之为前端,另一个节点我称之为后端。在前端节点中,我在代码中配置了一个集群路由器组,这使我可以将消息从前端发送到任何加入角色“后端”的节点(以循环方式)并且在 /user/ 有一个演员后端。我正在运行的代码如下所示:
system.ActorOf(Props.Empty.WithRouter(
new ClusterRouterGroup(
new RoundRobinGroup("/user/backend"),
new ClusterRouterGroupSettings(10, false, "backend", ImmutableHashSet.Create("/user/backend"))
)));
现在我想将此配置移动到配置文件中(hocon)。我将如何去做这样我只需要下面的代码来实例化它?
system.ActorOf(Props.Empty.WithRouter(FromConfig.Instance), "backend");
我的尝试只产生了没有任何线索的异常。
/backend {
router = round-robin-group
routees.paths = ["/user/backend"]
cluster {
enabled = on
max-nr-of-instances-per-node = 1
allow-local-routees = off
use-role = backend
}
}
有什么好的提示吗?我在异常中获得的唯一信息是:
Configuration problem while creating [akka://ClusterSystem/user/backend] with router dispatcher [akka.actor.default-dispatcher] and mailbox and routee dispatcher [akka.actor.default-dispatcher] and mailbox [].