一个集群可以有多个单例参与者吗?

Can a cluster have multiple singleton actors?

一个 Akka 集群中可以有多个不同的 actor 吗?

例如,假设我需要进入 多个 系统的单个入口点。我可能希望 Singleton1 负责进入 System1Singleton2 负责进入 系统2。拥有一个承担多项职责的单例 Actor 似乎并不理想。我当然同意两个单身演员 运行 在同一个节点上。

Akka docs 声明 ClusterSingletonManager "manages one singleton actor instance among all cluster nodes or a group of nodes." 这一点,连同配置文档示例,让我得出结论,我要求的是不可能的,但我想我会要求确认。谢谢!

此问题已在 Akka 用户列表中回答 here

You can create many different ClusterSingletonManager actors with different settings, each one managing one singleton.

It's the name of the actor (the second parameter to actorOf) that distinguishes them.

Normally you don't need different configuration in config file. You can use the ClusterSingletonManagerSettings if there is some small differences, such as the role. It's also possible to load ClusterSingletonManagerSettings from a config file section, but that is often not needed.

http://doc.akka.io/docs/akka/current/java/cluster-singleton.html

http://doc.akka.io/japi/akka/2.4/akka/cluster/singleton/ClusterSingletonManager.html