Supervision options


#1

For supervision, are these the only 2 options?

  1. Modify application.conf and set the akka.actor.guardian-supervisor-strategy value.
    If
    akka.actor.DefaultSupervisorStrategy – (will stop or restart the child actor depending on exception thrown
    akka.actor.StoppingSupervisorStrategy - It will stop the child actor

  2. Create a SupervisorActor, and define the strategy in that class. Then create the child actor from the SupervisorActor which will inherit those characteristics.


(Konrad `ktoso` Malawski) #2

The first thing you mention is special though – it is the user guardians supercision strategy. Only applies to actors started by the guardian, i.e. any actors that are /user/hello named-like. Others like /user/hello/child are handled the 2nd way, by their parent.

In general changing the user guardians strategy should not be needed most of the time as you are encouraged to start actors in a deeper hierarchy anyway.

Note that there’s also the Backoff supervision https://doc.akka.io/docs/akka/current/general/supervision.html#delayed-restarts-with-the-backoffsupervisor-pattern though it’s a separate mechanism, not the usual supervision one. In Akka Typed Actors this one is included in the “main” supervision mechanisms though, so we’re becoming more aligned there.