Package akka.persistence.typed.javadsl
Class ReplicatedEventSourcedOnCommandBehavior<Command,Event,State>
- java.lang.Object
-
- akka.actor.typed.Behavior<T>
-
- akka.actor.typed.internal.BehaviorImpl.DeferredBehavior<Command>
-
- akka.persistence.typed.javadsl.EventSourcedOnCommandBehavior<Command,Event,State>
-
- akka.persistence.typed.javadsl.ReplicatedEventSourcedOnCommandBehavior<Command,Event,State>
-
public abstract class ReplicatedEventSourcedOnCommandBehavior<Command,Event,State> extends EventSourcedOnCommandBehavior<Command,Event,State>
Base class for replicated event sourced behaviors for projects built with Java 17 or newer where message handling can be done using switch pattern match.For building replicated event sourced actors with Java versions before 17, see
ReplicatedEventSourcedBehavior
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.actor.typed.Behavior
Behavior.BehaviorDecorators<Inner>, Behavior.BehaviorDecorators$
-
-
Constructor Summary
Constructors Constructor Description ReplicatedEventSourcedOnCommandBehavior(ReplicationContext replicationContext)
ReplicatedEventSourcedOnCommandBehavior(ReplicationContext replicationContext, java.util.Optional<BackoffSupervisorStrategy> onPersistFailure)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Behavior<Command>
apply(TypedActorContext<Command> context)
INTERNAL API: DeferredBehavior init, not for user extensionprotected ReplicationContext
getReplicationContext()
java.util.Optional<ReplicationInterceptor<Event,State>>
replicationInterceptor()
If a callback is returned it is invoked when an event from another replica arrives, delaying persisting the event until the returned completion stage completes, if the future fails the actor is crashed.boolean
withEventPublishing()
Override and return false to disable events being published to the system event stream asPublishedEvent
after they have been persisted.-
Methods inherited from class akka.persistence.typed.javadsl.EventSourcedOnCommandBehavior
deleteEventsOnSnapshot, Effect, emptyState, eventAdapter, journalPluginId, lastSequenceNumber, newSignalHandlerBuilder, onCommand, onEvent, persistenceId, recovery, retentionCriteria, shouldSnapshot, signalHandler, snapshotAdapter, snapshotPluginId, snapshotSelectionCriteria, stashCapacity, tagsFor, tagsFor
-
Methods inherited from class akka.actor.typed.Behavior
BehaviorDecorators, canonicalize, existsInStack, interpretMessage, interpretSignal, isAlive, isDeferred, isUnhandled, narrow, start, validateAsInitial
-
-
-
-
Constructor Detail
-
ReplicatedEventSourcedOnCommandBehavior
public ReplicatedEventSourcedOnCommandBehavior(ReplicationContext replicationContext, java.util.Optional<BackoffSupervisorStrategy> onPersistFailure)
-
ReplicatedEventSourcedOnCommandBehavior
public ReplicatedEventSourcedOnCommandBehavior(ReplicationContext replicationContext)
-
-
Method Detail
-
apply
public Behavior<Command> apply(TypedActorContext<Command> context)
INTERNAL API: DeferredBehavior init, not for user extension- Overrides:
apply
in classEventSourcedOnCommandBehavior<Command,Event,State>
-
getReplicationContext
protected ReplicationContext getReplicationContext()
-
replicationInterceptor
public java.util.Optional<ReplicationInterceptor<Event,State>> replicationInterceptor()
If a callback is returned it is invoked when an event from another replica arrives, delaying persisting the event until the returned completion stage completes, if the future fails the actor is crashed.Only used when the entity is replicated.
-
withEventPublishing
public boolean withEventPublishing()
Override and return false to disable events being published to the system event stream asPublishedEvent
after they have been persisted.
-
-