Class OutboxEventExternalizer
java.lang.Object
org.springframework.modulith.events.support.OutboxEventExternalizer
- All Implemented Interfaces:
Aware,ApplicationEventPublisherAware
An
OutboxEventExternalizer that transports events from the outbox to an external target.
This handler is invoked by the outbox processor to externalize events that were previously recorded in the outbox table. It uses the configured transport function to deliver events to their target destination (e.g., message broker, email, SMS).
- Since:
- 2.1
- Author:
- Roland Beisel, Oliver Drotbohm
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOutboxEventExternalizer(EventExternalizationConfiguration configuration, BiFunction<RoutingTarget, Object, CompletableFuture<?>> transport) Creates a newOutboxEventExternalizerfor the givenEventExternalizationConfigurationand transport function. -
Method Summary
Modifier and TypeMethodDescriptionvoidHandles an outbox event by determining its routing target and transporting it to the external target using the configured transport function.voidsetApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
-
Constructor Details
-
OutboxEventExternalizer
public OutboxEventExternalizer(EventExternalizationConfiguration configuration, BiFunction<RoutingTarget, Object, CompletableFuture<?>> transport) Creates a newOutboxEventExternalizerfor the givenEventExternalizationConfigurationand transport function.- Parameters:
configuration- must not be null.transport- must not be null.
-
-
Method Details
-
setApplicationEventPublisher
- Specified by:
setApplicationEventPublisherin interfaceApplicationEventPublisherAware
-
handle
Handles an outbox event by determining its routing target and transporting it to the external target using the configured transport function.- Parameters:
event- the event payload to transport
-