Document persist failure supervision for ESBs #30062

This commit is contained in:
Christopher Batey 2021-04-07 10:33:08 +01:00 committed by GitHub
parent 71225b4f2b
commit 99ec6f9d82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -31,6 +31,10 @@ abstract class EventSourcedBehavior[Command, Event, State] private[akka] (
} }
/** /**
* If using onPersistFailure the supervision is only around the event sourced behavior not any outer setup/withTimers
* block. If using restart any actions e.g. scheduling timers, can be done on the PreRestart signal or on the
* RecoveryCompleted signal.
*
* @param persistenceId stable unique identifier for the event sourced behavior * @param persistenceId stable unique identifier for the event sourced behavior
* @param onPersistFailure BackoffSupervisionStrategy for persist failures * @param onPersistFailure BackoffSupervisionStrategy for persist failures
*/ */

View file

@ -208,6 +208,9 @@ object EventSourcedBehavior {
* Specifically BackOff to prevent resume being used. Resume is not allowed as * Specifically BackOff to prevent resume being used. Resume is not allowed as
* it will be unknown if the event has been persisted. * it will be unknown if the event has been persisted.
* *
* This supervision is only around the event sourced behavior not any outer setup/withTimers
* block. If using restart, any actions e.g. scheduling timers, can be done on the PreRestart
*
* If not specified the actor will be stopped on failure. * If not specified the actor will be stopped on failure.
*/ */
def onPersistFailure(backoffStrategy: BackoffSupervisorStrategy): EventSourcedBehavior[Command, Event, State] def onPersistFailure(backoffStrategy: BackoffSupervisorStrategy): EventSourcedBehavior[Command, Event, State]