Package akka.actor.typed
Class BackoffSupervisorStrategy
- java.lang.Object
-
- akka.actor.typed.SupervisorStrategy
-
- akka.actor.typed.BackoffSupervisorStrategy
-
public abstract class BackoffSupervisorStrategy extends SupervisorStrategy
Not for user extension
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.actor.typed.SupervisorStrategy
SupervisorStrategy.Backoff$, SupervisorStrategy.Restart$, SupervisorStrategy.RestartOrBackoff, SupervisorStrategy.Resume$, SupervisorStrategy.Stop$
-
-
Constructor Summary
Constructors Constructor Description BackoffSupervisorStrategy()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract java.time.Duration
getResetBackoffAfter()
abstract scala.concurrent.duration.FiniteDuration
resetBackoffAfter()
abstract BackoffSupervisorStrategy
withCriticalLogLevel(org.slf4j.event.Level criticalLevel, int afterErrors)
Possibility to use another log level after a given number of errors.abstract BackoffSupervisorStrategy
withLoggingEnabled(boolean enabled)
abstract BackoffSupervisorStrategy
withLogLevel(org.slf4j.event.Level level)
abstract BackoffSupervisorStrategy
withMaxRestarts(int maxRestarts)
Allow at most this number of failed restarts in a row.abstract BackoffSupervisorStrategy
withResetBackoffAfter(java.time.Duration timeout)
Java API: The back-off algorithm is reset if the actor does not crash within the specifiedresetBackoffAfter
.abstract BackoffSupervisorStrategy
withResetBackoffAfter(scala.concurrent.duration.FiniteDuration timeout)
Scala API: The back-off algorithm is reset if the actor does not crash within the specifiedresetBackoffAfter
.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.abstract BackoffSupervisorStrategy
withStopChildren(boolean enabled)
Stop or keep child actors when the parent actor is restarted.-
Methods inherited from class akka.actor.typed.SupervisorStrategy
loggingEnabled, logLevel, restart, restartWithBackoff, restartWithBackoff, resume, stop
-
-
-
-
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 withBackoffSupervisorStrategy.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.
-
withLogLevel
public abstract BackoffSupervisorStrategy withLogLevel(org.slf4j.event.Level level)
- Specified by:
withLogLevel
in classSupervisorStrategy
-
withLoggingEnabled
public abstract BackoffSupervisorStrategy withLoggingEnabled(boolean enabled)
- Specified by:
withLoggingEnabled
in classSupervisorStrategy
-
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 specifiedresetBackoffAfter
. By default, theresetBackoffAfter
has the value of(minBackoff + maxBackoff) / 2
.
-
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 specifiedresetBackoffAfter
. By default, theresetBackoffAfter
has the same value asminBackoff
.
-
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
- iftrue
then child actors are stopped, otherwise they are kept
-
-