Class BackoffSupervisorStrategy


  • public abstract class BackoffSupervisorStrategy
    extends SupervisorStrategy
    Not for user extension
    • Constructor Detail

      • BackoffSupervisorStrategy

        public BackoffSupervisorStrategy()
    • Method Detail

      • getResetBackoffAfter

        public abstract java.time.Duration getResetBackoffAfter()
      • resetBackoffAfter

        public abstract scala.concurrent.duration.FiniteDuration resetBackoffAfter()
      • withCriticalLogLevel

        public abstract BackoffSupervisorStrategy withCriticalLogLevel​(org.slf4j.event.Level criticalLevel,
                                                                       int afterErrors)
        Possibility to use another log level after a given number of errors. The initial errors are logged at the level defined with BackoffSupervisorStrategy.withLogLevel. For example, the first 3 errors can be logged at INFO level and thereafter at ERROR level.

        The counter (and log level) is reset after the BackoffSupervisorStrategy.withResetBackoffAfter duration.

      • withMaxRestarts

        public abstract BackoffSupervisorStrategy withMaxRestarts​(int maxRestarts)
        Allow at most this number of failed restarts in a row. Zero or negative disables the upper limit on restarts (and is the default)
      • withResetBackoffAfter

        public abstract BackoffSupervisorStrategy withResetBackoffAfter​(scala.concurrent.duration.FiniteDuration timeout)
        Scala API: The back-off algorithm is reset if the actor does not crash within the specified resetBackoffAfter. By default, the resetBackoffAfter has the same value as minBackoff.
      • withResetBackoffAfter

        public abstract BackoffSupervisorStrategy withResetBackoffAfter​(java.time.Duration timeout)
        Java API: The back-off algorithm is reset if the actor does not crash within the specified resetBackoffAfter. By default, the resetBackoffAfter has the same value as minBackoff.
      • withStashCapacity

        public abstract BackoffSupervisorStrategy withStashCapacity​(int capacity)
        While restarting (waiting for backoff to expire and children to stop) incoming messages and signals are stashed, and delivered later to the newly restarted behavior. This property defines the capacity in number of messages of the stash buffer. If the capacity is exceed then additional incoming messages are dropped.

        By default the capacity is defined by config property akka.actor.typed.restart-stash-capacity.

      • withStopChildren

        public abstract BackoffSupervisorStrategy withStopChildren​(boolean enabled)
        Stop or keep child actors when the parent actor is restarted. By default child actors are stopped when parent is restarted.
        Parameters:
        enabled - if true then child actors are stopped, otherwise they are kept