Class EventExternalizationSupport
java.lang.Object
org.springframework.modulith.events.support.EventExternalizationSupport
- All Implemented Interfaces:
ConditionalEventListener
- Direct Known Subclasses:
DelegatingEventExternalizer
Fundamental support for event externalization. Considers the configured
EventExternalizationConfiguration
before handing off the ultimate message publication to externalize(Object, RoutingTarget)
.- Since:
- 1.1
- Author:
- Oliver Drotbohm
-
Constructor Summary
ModifierConstructorDescriptionprotected
EventExternalizationSupport
(EventExternalizationConfiguration configuration) Creates a newEventExternalizationSupport
for the givenEventExternalizationConfiguration
. -
Method Summary
Modifier and TypeMethodDescriptionexternalize
(Object event) Externalizes the given event.protected abstract CompletableFuture<?>
externalize
(Object payload, RoutingTarget target) Publish the given payload to the givenRoutingTarget
.boolean
Returns whether the given event instance is supported by the listener.
-
Constructor Details
-
EventExternalizationSupport
Creates a newEventExternalizationSupport
for the givenEventExternalizationConfiguration
.- Parameters:
configuration
- must not be null.
-
-
Method Details
-
supports
Description copied from interface:ConditionalEventListener
Returns whether the given event instance is supported by the listener.- Specified by:
supports
in interfaceConditionalEventListener
- Parameters:
event
- must not be null.- Returns:
- whether the given event instance is supported by the listener.
-
externalize
@ApplicationModuleListener(propagation=SUPPORTS) public CompletableFuture<?> externalize(Object event) Externalizes the given event.- Parameters:
event
- must not be null.- Returns:
- the externalization result, will never be null.
-
externalize
Publish the given payload to the givenRoutingTarget
.- Parameters:
payload
- must not be null.target
- must not be null.- Returns:
- the externalization result, will never be null.
-