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 [].