0
votes

We are trying to create couple of node level actors [pool routers] for app level administration, local routing and throttling purposes.

Node specific role is mentioned as target role for these actors for STRICTLY local routing.

Below is the sample code and hocon.

//// In App Start - Actor is initialized and stored in static container
var props = Props.Create(() => new ThrottlerActor()).WithRouter(FromConfig.Instance);
actorSystem.ActorOf(props, "ThrottlerActor");

## hocon ##
/ThrottlerActor{
    router = round-robin-pool
    nr-of-instances = 100
    cluster {
        enabled = on
        allow-local-routees = on
        max-nr-of-instances-per-node = 10
        use-role = node1
    }
}

But when we send message to this actor, it behaves like a cluster actor. It redirects the n+1th [n = max-nr-of-instances-per-node] message to the similar actor in different node. It looks like as if the role setting was ignored.

We even tried disabling clustering [cluster -> enabled = off AND also by removing cluster configuration from hocon]. But it didn't work. The moment this router is created below user guardian, the actor behaves as if it is a cluster actor.

Please advise.

1
If you want to have local only router, the the whole cluster { ... } section in HOCON is unnecessary. Also allow-local-routees doesn't restrict router to work only locally, but also locally.Bartosz Sypytkowski
Yeah, we just tried using cluster config + node specific role, to see if it routes locally.. But no luck.. We understand how allow-local-routees work. But it was just a try.Dhivya DD
I also have another use case, to have single instance actor in "every node" for performing some administration activities. It will receive broadcasts from cluster client. For which we needed to have cluster configuration. Functionality of this actor is to route few local messages (single point of entry for those messages for an application specific need) as well as receives broadcasts and acts on it.Dhivya DD

1 Answers

0
votes

We even tried disabling clustering [cluster -> enabled = off AND also by removing cluster configuration from hocon]. But it didn't work. The moment this router is created below user guardian, the actor behaves as if it is a cluster actor.

So this smells to me like your HOCON isn't being loaded correctly. You can't have a router that routes to cluster routees on other nodes with cluster.enabled = off inside its deployment. The code needed to listen to the cluster in the first place gets elided with that off.

Try removing the cluster section in its entirety and work backwards. Your issue here seems to be which config is being loaded / where it's coming from - not a bug with Akka.NET.