akka.netakka.net-cluster

akka.net round robin group router - only routing to one routee


A question about cluster routers (strategy = round-robin-group). I can't get it to round robin between my routees in a clustered setup.

My setup is as follows: Node A, starting its actor system in the context of ASP.NET. In there I have a API controller that talks to actor A1, this actor then talks to my router. This router should then round robin the messages to its routees that are created on node B (using the worker role).

Node B creates its actor system within the context of a windows service. I have double checked that all of my routees on node B are actually created (done at service startup).

In order to check which of the routees that receive the message sent from the router at node A, I just console log Self.Path in my Receive handle. For some reason, the same routee gets all the messages and they are not distributed around the routees.

Se config on node A below.

/workerRouter {
   router = round-robin-group
   routees.paths = [
      "/user/workers/worker0",
      "/user/workers/worker1", 
      "/user/workers/worker2",
      "/user/workers/worker3",
      "/user/workers/worker4",
      "/user/workers/worker5",
      "/user/workers/worker6",
      "/user/workers/worker7",
      "/user/workers/worker8",
      "/user/workers/worker9"
  ]
  cluster {
     enabled = on
     use-role = worker
  }
}

The router is instantiated with the following code:

ActorSystem.ActorOf(Props.Empty.WithRouter(FromConfig.Instance), "workerRouter");

Using versions:


Solution

  • As discussed in Gitter adding a nr-of-instances = 10 under /workerRouter makes the router to accept all the routees.