Class ReplicatedEventSourcedBehavior<Command,​Event,​State>


  • public abstract class ReplicatedEventSourcedBehavior<Command,​Event,​State>
    extends EventSourcedBehavior<Command,​Event,​State>
    Base class for replicated event sourced behaviors.

    For projects using Java 17 and newer, also see EventSourcedOnCommandBehavior

    • Method Detail

      • 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 as PublishedEvent after they have been persisted.