Akka cluster: why don't I receive a Reachable event?

170 Views Asked by At

I have two nodes in a Akka cluster.

I subscribe to all ClusterDomainEvent of the cluster with:

cluster.subscribe(
    self,
    InitialStateAsEvents,
    classOf[ClusterDomainEvent])

When one of the two nodes is down, I receive a Unreachable event and I start to receive some logs every few seconds that warn me as following:

Association with remote system [akka.tcp://[email protected]:2554] has failed

When the down node come back, the logs stop, so it is detected that the node is reachable again but I still don't get a ReachableMember event.

What am I missing? Why should I do in order to receive this cluster event?

1

There are 1 best solutions below

1
On

The way of doing it is to subscribe to cluster events with classOf[ReachabilityEvent]

So

cluster.subscribe(
  self,
  InitialStateAsEvents,
  classOf[MemberEvent],
  classOf[ReachabilityEvent])