1

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://application@127.0.0.1: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?

Simon
  • 6,025
  • 7
  • 46
  • 98

1 Answers1

0

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

So

cluster.subscribe(
  self,
  InitialStateAsEvents,
  classOf[MemberEvent],
  classOf[ReachabilityEvent])
Simon
  • 6,025
  • 7
  • 46
  • 98
  • That's strange, from Akka code I can see, that `ClusterDomainEvent` includes `ReachabilityEvent` (`sealed trait ReachabilityEvent extends ClusterDomainEvent`). That shouldn't have made a difference. – Valentina Aug 22 '19 at 09:29