public class OutboundEventMessageChannelAdapter extends Object implements org.springframework.beans.factory.InitializingBean
EventBus
.
Optionally, this adapter can be configured with a filter, which can block or accept messages based on their type.Constructor and Description |
---|
OutboundEventMessageChannelAdapter(SubscribableMessageSource<EventMessage<?>> messageSource,
org.springframework.messaging.MessageChannel channel)
Initialize an adapter to forward messages from the given
messageSource to the given channel . |
OutboundEventMessageChannelAdapter(SubscribableMessageSource<EventMessage<?>> messageSource,
org.springframework.messaging.MessageChannel channel,
Predicate<? super EventMessage<?>> filter)
Initialize an adapter to forward messages from the given
messageSource to the given channel . |
OutboundEventMessageChannelAdapter(SubscribableMessageSource<EventMessage<?>> messageSource,
org.springframework.messaging.MessageChannel channel,
Predicate<? super EventMessage<?>> filter,
EventMessageConverter eventMessageConverter)
Initialize an adapter to forward messages from the given
messageSource to the given channel . |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Subscribes this event listener to the event bus.
|
protected void |
handle(List<? extends EventMessage<?>> events)
If allows by the filter, wraps the given
event in a GenericMessage ands sends it to the
configured MessageChannel . |
protected org.springframework.messaging.Message<?> |
transform(EventMessage<?> event)
Transforms the given Axon
event into a Spring Messaging Message. |
public OutboundEventMessageChannelAdapter(SubscribableMessageSource<EventMessage<?>> messageSource, org.springframework.messaging.MessageChannel channel)
messageSource
to the given channel
.
Messages are not filtered; all messages are forwarded to the MessageChannelmessageSource
- The event bus to subscribe to.channel
- The channel to send event messages to.public OutboundEventMessageChannelAdapter(SubscribableMessageSource<EventMessage<?>> messageSource, org.springframework.messaging.MessageChannel channel, Predicate<? super EventMessage<?>> filter)
messageSource
to the given channel
.
Messages are filtered using the given filter
.messageSource
- The source of messages to subscribe to.channel
- The channel to send event messages to.filter
- The filter that indicates which messages to forward.public OutboundEventMessageChannelAdapter(SubscribableMessageSource<EventMessage<?>> messageSource, org.springframework.messaging.MessageChannel channel, Predicate<? super EventMessage<?>> filter, EventMessageConverter eventMessageConverter)
messageSource
to the given channel
.
Messages are filtered using the given filter
.messageSource
- The source of messages to subscribe to.channel
- The channel to send event messages to.filter
- The filter that indicates which messages to forward.eventMessageConverter
- The converter to use to convert event message into Spring messagepublic void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
protected void handle(List<? extends EventMessage<?>> events)
event
in a GenericMessage
ands sends it to the
configured MessageChannel
.events
- the events to handleprotected org.springframework.messaging.Message<?> transform(EventMessage<?> event)
event
into a Spring Messaging Message. This method may be overridden to change
how this transformation should occur.event
- The Axon EventMessage to transformCopyright © 2010–2024. All rights reserved.