private static void CreateClusterNode(Config commonConfig, int port, params string[] roles)
{
var config = commonConfig
.WithFallback("akka.remote.helios.tcp.port = " + port)
.WithFallback("akka.cluster.roles = " + "[" + string.Join(",", roles) + "]");
var system = ActorSystem.Create("BasicCluster", config);
var cluster = Cluster.Get(system);
var clusterNode = new ClusterNode
{
Context = new ClusterNodeContext
{
System = system,
ClusterActorDiscovery = system.ActorOf(Props.Create(() => new ClusterActorDiscovery(cluster)),
"cluster_actor_discovery")
},
Roles = roles
};
InitClusterNode(clusterNode);
_clusterNodes.Add(clusterNode);
}