Class 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

    • Constructor Detail

      • ReplicatedEventSourcedOnCommandBehavior

        public ReplicatedEventSourcedOnCommandBehavior​(ReplicationContext replicationContext)
    • 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.