I am brand new to Akka but my understanding about the Stop
directive is that it is used inside of SupervisorStrategies
when the child should be considered permanently out of service, but there is a way to handle the total outage.
If that understanding is correct, then what I would like to do is have some kind of a “backup actor” that should be engaged after the normal/primary child is stopped and used from that point forward as a fallback. For example, say I have a parent actor who has a child actor - Notifier
- whose job it is to send emails. If the Notifier
truly dies (say, the underlying mail server goes offline), a backup to this actor might be another actor, say, QueueClient
, that sends the notification request to a message broker, where the message will be queued up and replayed at a later time.
How can I define such a SupervisorStrategy
to have this built in fault tolerance/actor backup inside of it? Please show code examples, its the only way I will learn!