diff --git a/akka-persistence-typed/src/main/scala/akka/persistence/typed/javadsl/EventSourcedBehavior.scala b/akka-persistence-typed/src/main/scala/akka/persistence/typed/javadsl/EventSourcedBehavior.scala index 1bd0cb1d22..9895728a72 100644 --- a/akka-persistence-typed/src/main/scala/akka/persistence/typed/javadsl/EventSourcedBehavior.scala +++ b/akka-persistence-typed/src/main/scala/akka/persistence/typed/javadsl/EventSourcedBehavior.scala @@ -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 onPersistFailure BackoffSupervisionStrategy for persist failures */ diff --git a/akka-persistence-typed/src/main/scala/akka/persistence/typed/scaladsl/EventSourcedBehavior.scala b/akka-persistence-typed/src/main/scala/akka/persistence/typed/scaladsl/EventSourcedBehavior.scala index df6ceed64d..4577b892ac 100644 --- a/akka-persistence-typed/src/main/scala/akka/persistence/typed/scaladsl/EventSourcedBehavior.scala +++ b/akka-persistence-typed/src/main/scala/akka/persistence/typed/scaladsl/EventSourcedBehavior.scala @@ -208,6 +208,9 @@ object EventSourcedBehavior { * Specifically BackOff to prevent resume being used. Resume is not allowed as * 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. */ def onPersistFailure(backoffStrategy: BackoffSupervisorStrategy): EventSourcedBehavior[Command, Event, State]