0
votes

I am trying to use round-robin-pool with ClusterActorRefProvider and deploy actors to members with a certain role.

The actors are created and executed remotely and this is fine, but what I noticed additional members are created each time I tell to the router which is unexpected.

[INFO] [08/10/2015 00:15:55.507] [ClusterSystem-akka.actor.default-dispatcher-2] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://[email protected]:41362] - Welcome from [akka.tcp://[email protected]:4054]

[INFO] [08/10/2015 00:15:55.744] [ClusterSystem-akka.actor.default-dispatcher-7] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://[email protected]:41380] - Welcome from [akka.tcp://[email protected]:4054]

The configuration is defined as follows:

akka {
  actor {
    provider = "akka.cluster.ClusterActorRefProvider"
    deployment {
      "/container/hello" {
        router = round-robin-pool
        nr-or-instances = 30
        cluster {
          enabled = on
          max-nr-of-instances-per-node = 3
          allow-local-routees = off
          use-role = server
        }
      }
    }
  }
  remote {
    log-remote-lifecycle-events = DEBUG
    log-received-messages = on
    netty.tcp {
      hostname = "127.0.0.1"
      port = 0
    }
  }

  cluster {
    min-nr-of-members = 3
    seed-nodes = [
      "akka.tcp://[email protected]:4054"
      ]
    roles = ["client"]
    auto-down-unreachable-after = 10s
  }
}

Any help appreciated.

AKKA version: "2.3.12"

1
After looking into the details of the problem closer, I found the problem is not in the configuration but rather in the code itself. I've made a typo and had: def system = ActorSystem("mySystem") instead of val system = .... As a result the actor system was instancitated each time system was used.Nick Rubell

1 Answers

0
votes

After looking into the details of the problem closer, I found the problem is not in the configuration but rather in the code itself. I've made a typo and had:

def system = ActorSystem("mySystem")

instead of

val system = ....

As a result the actor system was instantiated each time system was used.