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
ConstructorsModifierConstructorDescriptionprotectedEventExternalizationSupport(EventExternalizationConfiguration configuration) Creates a newEventExternalizationSupportfor 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.booleanReturns whether the given event instance is supported by the listener.
-
Constructor Details
-
EventExternalizationSupport
Creates a newEventExternalizationSupportfor the givenEventExternalizationConfiguration.- Parameters:
configuration- must not be null.
-
-
Method Details
-
supports
Description copied from interface:ConditionalEventListenerReturns whether the given event instance is supported by the listener.- Specified by:
supportsin interfaceConditionalEventListener- Parameters:
event- must not be null.- Returns:
- whether the given event instance is supported by the listener.
-
externalize
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.
-