I've set up one Akka.Net node to be the seed node in a cluster,which I call frontend, and another node which I call backend. In the frontend node I configure a cluster router group in code which makes it possible for me to send messages from the frontend to any nodes joining with the role 'backend' (in a round robin fashion) and that have an actor at /user/backend. The code that I have that is working looks like this:
system.ActorOf(Props.Empty.WithRouter(
new ClusterRouterGroup(
new RoundRobinGroup("/user/backend"),
new ClusterRouterGroupSettings(10, false, "backend", ImmutableHashSet.Create("/user/backend"))
)));
Now I want to move this configuration to the config file instead (hocon). How would I go about doing that so that I only need the following code to instantiate it?
system.ActorOf(Props.Empty.WithRouter(FromConfig.Instance), "backend");
My attempt has only yielded exceptions with no clues.
/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
}
}
Any good hints? The only information I'm getting in the exception is:
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 [].
It's hard to say without seeing the full HOCON config. Seems like you just want a cluster-aware group router. Nothing obvious jumps out at me, but here are a few things that come to mind where I'd start looking:
frontend
needs itself as a seed node too. It will "join itself" to start the cluster.Akka.Cluster
in HOCON, including specifying theakka.cluster
andakka.remote
HOCON sections./backend
inside the proper HOCON section? Needs to be inakka.actor.deployment
.max-nr-of-instances-per-node
flag for a Group router. That's for pool routers to limit how many routees they deploy onto a given node in the cluster.Here is a sample config that should work for the
frontend
node, based on what I can see. But it'd be helpful if you can add your full HOCON.