Not able to create node level local actors in Akka.Net cluster

130 views Asked by At

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

There are 1 answers

0
Aaronontheweb On

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.