I'm using Akka 2.3.11 and SupervisorStrategies for handling failures in the actors subordinates. However in addition to the supervision strategy I want to catch all "stops" (planned stops and such one which occur because of exceptions) of a subordinate to persist some information in the backends database.
How can I catch all stops of the subordinates in the supervisor?
You can
watch
any actor and receive aTerminated
message whenever that actor stops.To watch an actor user:
and receive
Terminated
message just like any other message and do whatever backend jobs that you need there.