Class DelegatingEventExternalizer
java.lang.Object
org.springframework.modulith.events.support.EventExternalizationSupport
org.springframework.modulith.events.support.DelegatingEventExternalizer
- All Implemented Interfaces:
ConditionalEventListener
An
EventExternalizationSupport
delegating to a BiConsumer
for the actual externalization. Note, that
this needs to be a Component
to make sure it is considered an event listener, as without the
annotation Spring Framework would skip it as it lives in the org.springframework
package.- Since:
- 1.1
- Author:
- Oliver Drotbohm
-
Constructor Summary
ConstructorDescriptionDelegatingEventExternalizer
(EventExternalizationConfiguration configuration, BiConsumer<RoutingTarget, Object> delegate) Creates a newDelegatingEventExternalizer
for the givenEventExternalizationConfiguration
andBiConsumer
implementing the actual externalization. -
Method Summary
Modifier and TypeMethodDescriptionvoid
externalize
(Object event) Externalizes the given event.protected void
externalize
(Object payload, RoutingTarget target) Publish the given payload to the givenRoutingTarget
.Methods inherited from class org.springframework.modulith.events.support.EventExternalizationSupport
supports
-
Constructor Details
-
DelegatingEventExternalizer
public DelegatingEventExternalizer(EventExternalizationConfiguration configuration, BiConsumer<RoutingTarget, Object> delegate) Creates a newDelegatingEventExternalizer
for the givenEventExternalizationConfiguration
andBiConsumer
implementing the actual externalization.- Parameters:
configuration
- must not be null.delegate
- must not be null.
-
-
Method Details
-
externalize
Description copied from class:EventExternalizationSupport
Externalizes the given event.- Overrides:
externalize
in classEventExternalizationSupport
- Parameters:
event
- must not be null.
-
externalize
Description copied from class:EventExternalizationSupport
Publish the given payload to the givenRoutingTarget
.- Specified by:
externalize
in classEventExternalizationSupport
- Parameters:
payload
- must not be null.target
- must not be null.
-