Hi everyone,
I have a service running as ClusterSharding with some coordinators which are started from a InitActor using the ShardedDaemonProcess, and at the current time everything works and the Coordiantors can talk to each other, whenever needed across the cluster.
However I’m currently in a situation where I need to create a Singleton actor across the whole Cluster which by definition would be unique and the root entrance to do operations on all this coordinators. I have searched for the ClusterSingleton which seems to be what I needed for my situation, but I’m facing some issues.
-
I tried to start the ClusterSingleton on the InitActor (ActorSystem) which will create the ClusterSingletonActor and this Singleton then start the ShardedDaemonProcess (with the CoordinatorActors) however I’m facing an issue where the Singleton is not able to communicate with the Coordinators on the Shards
Seamed to me the ClusterSingleton is outside the ShardedDaemonProcess (the cluster shards) and thus in cannot communicate with the Coordinators. But I’m not 100% sure that this is the issue -
Another approach I’m thinking of is starting the ShardedDaemonProcess on the InitActor (ActorSystem), as it is working on the current code, and them I’ll will create the ClusterSingleton (handling it’s creation logic like a normal Singleton class, to avoid altering the initial ActorRef). But I don’t think this is the best approach.
Based on the above situations, do anyone have faced a similar situation, needing to have a ClusterSingleton working on a ClusterSharding server in which the Coordinators actors are started by the ShardedDaemonProcess, that could give me some tips on how I could approach this situation?
Thanks in advance for any suggestion.