These are chat archives for akkadotnet/akka.net

9th
Mar 2018
Greatsamps
@Greatsamps
Mar 09 2018 05:58

Hey Guys. So i am working on a project with two Cluster Singleton's and proxies.

To keep this simple, lets assume 2 different processes, joined in a cluster, and 2 actors, Actor1 and Actor2, running as a singleton on each process. Each process has a role defined, Process1 = RoleProcess2, Process2 = RoleProcess2. When creating the Actor1 Singleton on Proces1, I am specifying RoleProcess1 so that it is bound to that process only, I do the same for Process2 with roles changed. This works as expected and the singletons are created.

I then need to create a proxy on each process referring to the other. For example, on Process2, I create a SingletonProxy that points to the Actor1 Singleton on Process1. I had previously been configuring this with a role of RoleProcess2 as that is the process that I wanted the proxy bound to, but this does not ever identify the singleton. After quite a bit of messing around, it seems that I need to configure the Proxy role to the same as the ClusterSingleton, RoleProcess1 in this example, at which point it works just fine.

This seems a bit arse about face to me. Is this correct, and could someone help with the reasoning behind this?

I can pop over a single class example of all of the above if it helps.

Bartosz Sypytkowski
@Horusiath
Mar 09 2018 07:11
@Greatsamps when specifying a cluster singleton, you can add role to tell it on which nodes (recognized by that role) is it allowed to live on. When specifying singleton proxy, a role is used to tell proxy gateway, on which nodes singleton can be found. So given process1 living on nodes with role RoleProcess1 and process2 living on nodes with role RoleProcess2, if process1 wants to talk to process2 it should use singleton proxy configured to RoleProcess2 as this is where process2 can be found.
Greatsamps
@Greatsamps
Mar 09 2018 07:23
@Horusiath many thanks, that makes sense :)
ziya
@mtmk
Mar 09 2018 11:50
Hi guys. What do you suggest to limit the number of child actors? Not a strict limit but when hitting the limit I would like to start sending poison pills to oldest (or preferably most idle) children. Any suggestions?
Bartosz Sypytkowski
@Horusiath
Mar 09 2018 12:08
@mtmk pretty much the default behavior is to set a receive timeout - this way an actor, which didn't received any message for a given timeout, will send a ReceiveTimeout message to itself. You can then stop that actor as reaction on that event.
ziya
@mtmk
Mar 09 2018 12:23
That sound perfect. Also is there a way to see how long an actor has been idle? This is so that if I have a bunch of actors and I want to kill only the most idle ones
ziya
@mtmk
Mar 09 2018 15:23
A test kit question. I am trying to test if the child of the actor I created with ActorOfAsActorRef successfully stopped. How can I get a handle to the list of child actors? Is there another way (without creating additional messages)?
Edson Flores Palma
@Efp95
Mar 09 2018 23:46
Hello,
I would like to override some specific properties on hocon using code
I've been trying doing Fallback. But, it ignores inner sections i.e. singleton, distributed-data, etc (inside cluster)
How could I, as sample, assign seeds for cluster and keep my ddata properties already setup on config file?