Dear Akka users,
I have a supervisor actor S and child actor C (which is performing blocking operation).
I know that C can fail and I want to retry it every minute, therefore I should use:
final Props supervisorProps = BackoffSupervisor.props( Backoff.onFailure( CActor.props(), "c-actor", FiniteDuration.create(50, TimeUnit.SECONDS), FiniteDuration.create(70, TimeUnit.SECONDS), 0.2) );
But the case is: if actor C fails, I want to start “BackupActor” B (which should be active only when C is not performing properly) so I should notify S about failure.
Therefore I should use
and listen for Terminated message by S (to start actor B).
Unfortunatelly in this approach Terminated is send only when actor C is stopped, not restarted by Backoff
What should I do?
How to use Backoff to restart C automatically, but also react and start/stop B on error/recover?