Package akka.persistence.typed.javadsl
Class ReplicatedEventSourcedOnCommandWithReplyBehavior<Command,Event,State>
- java.lang.Object
-
- akka.actor.typed.Behavior<T>
-
- akka.actor.typed.internal.BehaviorImpl.DeferredBehavior<Command>
-
- akka.persistence.typed.javadsl.EventSourcedOnCommandWithReplyBehavior<Command,Event,State>
-
- akka.persistence.typed.javadsl.ReplicatedEventSourcedOnCommandWithReplyBehavior<Command,Event,State>
-
public abstract class ReplicatedEventSourcedOnCommandWithReplyBehavior<Command,Event,State> extends EventSourcedOnCommandWithReplyBehavior<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.Enforces replies to every received command.
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 ReplicatedEventSourcedOnCommandWithReplyBehavior(ReplicationContext replicationContext)
ReplicatedEventSourcedOnCommandWithReplyBehavior(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.EventSourcedOnCommandWithReplyBehavior
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
-
ReplicatedEventSourcedOnCommandWithReplyBehavior
public ReplicatedEventSourcedOnCommandWithReplyBehavior(ReplicationContext replicationContext, java.util.Optional<BackoffSupervisorStrategy> onPersistFailure)
-
ReplicatedEventSourcedOnCommandWithReplyBehavior
public ReplicatedEventSourcedOnCommandWithReplyBehavior(ReplicationContext replicationContext)
-
-
Method Detail
-
apply
public Behavior<Command> apply(TypedActorContext<Command> context)
INTERNAL API: DeferredBehavior init, not for user extension- Overrides:
apply
in classEventSourcedOnCommandWithReplyBehavior<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.
-
-