1

I believe there is some problem with my configuration. Please consider the following setup:

On "receiver" node:

List<String> path = singletonList("/user/processorRouter");
processorRouter = context().actorOf(
       new ClusterRouterGroup(new RoundRobinGroup(path), 
             new ClusterRouterGroupSettings(10, path, false, "processor")).props(), "clusterProcessorRouter");

On "processor" node (it has "processor" role):

ActorRef processorRouter = system.actorOf(
      SpringProps.create(system, ProcessorActor.class).withRouter(
              new RoundRobinPool(10)), "processorRouter");

(I'm using Spring Extension to create actors, but I believe that does not matter in this case)

The problem is, when I send a message from Receiver node actors:

processorRouter.tell(data, self());

Akka delivers this messages only sometimes. Here what I can see in logs:

receiver_1: Receiver sent a message to processor: TEST
receiver_1: Receiver sent a message to processor: TEST
receiver_1: Receiver sent a message to processor: TEST
receiver_1: Receiver sent a message to processor: TEST
receiver_1: Receiver sent a message to processor: TEST
processor_1: Processor got a message: TEST
receiver_1: Receiver sent a message to processor: TEST
receiver_1: Receiver sent a message to processor: TEST
...

When I send a message directly to that router from the "receiver" node, ALL messages are delivered successfully to the "processor":

system.actorFor(
       "akka.tcp://robot-system@172.18.0.4:2552/user/processorRouter")
             .tell(data, ActorRef.noSender());

Can't find the problem with cluster aware router config. Please help me!

silent-box
  • 1,649
  • 3
  • 21
  • 40

0 Answers0