Death watching across clusters


Use case description,

We have akka cluster A and akka cluster B. Our deathwatch actor is part of cluster A and another actor that we want to watch is part of cluster B. We are able to send actor msgs across clusters. But death watching across clusters is not happening. We enabled logs as well and found out that no heartbeat msgs are being sent. We have following scenarios for death watching in our application, out of which scenario 3 (death watching across clusters) is not working for us.

Scenarios :-

Scenario 1 : Deathwatch actor (in Cluster A) watches other actors in cluster A (WORKING) :white_check_mark:

Scenario 2 : Deathwatch actor (in Cluster A) watches other remote actors which are not part of any cluster (WORKING) using akka.remote.use-unsafe-remote-features-outside-cluster = on :white_check_mark:

Scenario 3 : Deathwatch actor (in Cluster A) watched other actor in cluster B (NOT WORKING)

Essentially we are looking for scenario 3. Is there a way to get this working?

p.s. - We are using akka 2.6.4


If you really need a model like this, I strongly suggest you rethink it. Its just plain wrong if you ask me, and will most likely depend on behaviour that is subject to change.


1 Like


I will explain why are we in need of this use case. We already have one cluster set up with CRDT (akka distributed data). This CRDT is nothing but service discovery which replicate data of actor address across cluster. Death watch actor is also running in same cluster which watch all these actor locations stored in CRDT. Now we are have requirement for cluster singleton for one of our usecase and this singleton also need to be watched by our death watch actor. Death watch actor and CRDT cluster are already in place. So we want to evaluate that if there are 2 clusters (one for CRDT and other for cluster singleton) then deathwatch actor in cluster 1 (CRDT cluster) will be able to watch cluster singleton (cluster 2) or not.

That’s why need of death watching across clusters.

If this is not possible then we have to use one cluster for CRDT, death watch actor and cluster singleton.

It still doesn’t sound correct to me. Why do you need 2 actorsystems in the first place ? Doing cross-cluster actorwatches creates a tight coupling, so you might as well put it in a single actorsystem, and use roles.