Class EventExternalizerSupport
java.lang.Object
org.springframework.modulith.events.support.EventExternalizerSupport
- Direct Known Subclasses:
TransportAwareEventExternalizer
Fundamental support for event externalization. Considers the configured
EventExternalizationConfiguration
before handing off the ultimate message publication to externalize(Object, RoutingTarget).- Since:
- 2.1
- Author:
- Oliver Drotbohm
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEventExternalizerSupport(EventExternalizationConfiguration configuration) Deprecated, for removal: This API element is subject to removal in a future version.since 2.2, 2.1.2, for removal in 2.3.protectedEventExternalizerSupport(EventExternalizationConfiguration configuration, BeanFactory beanFactory) Creates a newEventExternalizerSupportfor the givenEventExternalizationConfiguration, resolving routing target and key expressions (which may refer to beans) against the original event using anEvaluationContextbacked by the givenBeanFactory. -
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.
-
Constructor Details
-
EventExternalizerSupport
@Deprecated(since="2.2, 2.1.2", forRemoval=true) protected EventExternalizerSupport(EventExternalizationConfiguration configuration) Deprecated, for removal: This API element is subject to removal in a future version.since 2.2, 2.1.2, for removal in 2.3. UseEventExternalizerSupport(EventExternalizationConfiguration, BeanFactory)instead.Creates a newEventExternalizerSupportfor the givenEventExternalizationConfiguration, not resolving bean references in routing target and key expressions.- Parameters:
configuration- must not be null.
-
EventExternalizerSupport
protected EventExternalizerSupport(EventExternalizationConfiguration configuration, BeanFactory beanFactory) Creates a newEventExternalizerSupportfor the givenEventExternalizationConfiguration, resolving routing target and key expressions (which may refer to beans) against the original event using anEvaluationContextbacked by the givenBeanFactory.- Parameters:
configuration- must not be null.beanFactory- must not be null.- Since:
- 2.2, 2.1.2
-
-
Method Details
-
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.
-