Interface EventSink
- All Superinterfaces:
DescribableComponent
- All Known Subinterfaces:
EventBus,EventStore
- All Known Implementing Classes:
DelegatingEventBus,InterceptingEventBus,InterceptingEventSink,InterceptingEventStore,RecordingEventBus,RecordingEventSink,RecordingEventStore,SimpleEventBus,StorageEngineBackedEventStore
events.
When a ProcessingContext is provided, the publication is typically staged in the
post invocation phase of the ProcessingContext. As a
consequence, the result of publication will be made apparent in the ProcessingContext. When providing no
ProcessingContext, the result of publication is carried in the resulting CompletableFuture.
- Since:
- 5.0.0
- Author:
- Allard Buijze, Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptionpublish(ProcessingContext context, List<EventMessage> events) Publishes the giveneventswithin the givencontext, when present.default CompletableFuture<Void> publish(ProcessingContext context, EventMessage... events) Publishes the giveneventswithin the givencontext, when present.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
publish
default CompletableFuture<Void> publish(@Nullable ProcessingContext context, EventMessage... events) Publishes the giveneventswithin the givencontext, when present.When present, the
post invocationphase is used to publish theevents. As a consequence, the resultingCompletableFuturecompletes when theeventsare staged in that phase.When no
ProcessingContextis provided, implementers of this interface may choose to create aProcessingContextwhen necessary.- Parameters:
context- The processing context, if any, to publish the giveneventsin.events- Theeventsto publish in this sink.- Returns:
- A
CompletableFutureofVoid. When this completes and a non-nullcontextwas given, this means theeventshave been successfully staged. When a nullcontextwas provided, successful completion of this future means theeventswhere published.
-
publish
CompletableFuture<Void> publish(@Nullable ProcessingContext context, @Nonnull List<EventMessage> events) Publishes the giveneventswithin the givencontext, when present.When present, the
post invocationphase is used to publish theevents. As a consequence, the resultingCompletableFuturecompletes when theeventsare staged in that phase.When no
ProcessingContextis provided, implementers of this interface may choose to create aProcessingContextwhen necessary.- Parameters:
context- The processing context, if any, to publish the giveneventsin.events- Theeventsto publish in this sink.- Returns:
- A
CompletableFutureofVoid. When this completes and a non-nullcontextwas given, this means theeventshave been successfully staged. When a nullcontextwas provided, successful completion of this future means theeventswhere published.
-