The akka documentation indicates that a node that
has become disconnected from the cluster will only reconnect after the ActorSystem has been restarted. The
documentation is surprisingly silent on how that might be implemented, trade-offs and consequences.
Use the akka cluster sample as a
starting point. Start the two backends on 2551 and 2552, and then start the frontend. Note that the
frontend does not reconnect if the two backends are stopped and then restarted.
The code below modifies the frontend to shutdown the ActorSystem when the number of backends falls to zero
A callback then restarts the ActorSystem and associated actors once the ActorSystem shutdown is complete.
The foreground will now reconnect when the backends restart.