Class DefaultEventGateway
java.lang.Object
org.axonframework.messaging.eventhandling.gateway.DefaultEventGateway
- All Implemented Interfaces:
EventGateway
Default implementation of the
EventGateway interface using the EventSink to publish events.- Since:
- 4.1.0
- Author:
- Bert laverman, Mitchell Herrijgers
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultEventGateway(EventSink eventSink, MessageTypeResolver messageTypeResolver) Creates a newEventGatewaythat uses the giveneventSinkto publish events. -
Method Summary
Modifier and TypeMethodDescriptionpublish(ProcessingContext context, List<?> events) Publishes the giveneventswithin the givencontext.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.eventhandling.gateway.EventGateway
publish, publish
-
Constructor Details
-
DefaultEventGateway
public DefaultEventGateway(@Nonnull EventSink eventSink, @Nonnull MessageTypeResolver messageTypeResolver) Creates a newEventGatewaythat uses the giveneventSinkto publish events. ThemessageTypeResolveris used to resolve the type of the event if noEventMessageis provided but a payload.- Parameters:
eventSink- TheEventSinkto publish events to.messageTypeResolver- TheMessageTypeResolverto resolve the type of the event.
-
-
Method Details
-
publish
public CompletableFuture<Void> publish(@Nullable ProcessingContext context, @Nonnull List<?> events) Description copied from interface:EventGatewayPublishes the giveneventswithin the givencontext. When present, theeventsshould be published as part of thecontext'slifecycle.The
eventsare mapped toEventMessagesbefore they are given to anEventSink.- Specified by:
publishin interfaceEventGateway- Parameters:
context- The processing context, if any, to publish the giveneventsin.events- The collection of events to publish.- Returns:
- A
CompletableFutureofVoid. Completion of the future depends on theEventSinkused by this gateway.
-