public class InboundEventMessageChannelAdapter extends Object implements org.springframework.messaging.MessageHandler, SubscribableMessageSource<EventMessage<?>>
Constructor and Description |
---|
InboundEventMessageChannelAdapter()
Initialize the adapter to publish all incoming events to the subscribed processors.
|
InboundEventMessageChannelAdapter(EventBus eventBus)
Initialize an InboundEventMessageChannelAdapter instance that sends all incoming Event Messages to the given
eventBus . |
InboundEventMessageChannelAdapter(List<Consumer<List<? extends EventMessage<?>>>> processors,
EventMessageConverter eventMessageConverter)
Initialize the adapter to publish all incoming events to the subscribed processors.
|
Modifier and Type | Method and Description |
---|---|
void |
handleMessage(org.springframework.messaging.Message<?> message)
Handles the given
message . |
Registration |
subscribe(Consumer<List<? extends EventMessage<?>>> messageProcessor)
Subscribe the given
messageProcessor to this message source. |
protected EventMessage<?> |
transformMessage(org.springframework.messaging.Message<?> message)
Transforms the given incoming Spring Messaging
message to an Axon EventMessage. |
public InboundEventMessageChannelAdapter()
public InboundEventMessageChannelAdapter(EventBus eventBus)
eventBus
. It is still possible for other Event Processors to subscribe to this MessageChannelAdapter.eventBus
- The EventBus instance for forward all messages topublic InboundEventMessageChannelAdapter(List<Consumer<List<? extends EventMessage<?>>>> processors, EventMessageConverter eventMessageConverter)
processors
- Processors to be subscribedeventMessageConverter
- The message converter to use to convert spring message into event message@Nonnull public Registration subscribe(@Nonnull Consumer<List<? extends EventMessage<?>>> messageProcessor)
SubscribableMessageSource
messageProcessor
to this message source. When subscribed, it will receive all
messages published to this source.
If the given messageProcessor
is already subscribed, nothing happens.
subscribe
in interface SubscribableMessageSource<EventMessage<?>>
messageProcessor
- The message processor to subscribemessageProcessor
. When unsubscribed it will no longer receive
messages.public void handleMessage(@Nonnull org.springframework.messaging.Message<?> message)
message
. If the filter refuses the message, it is ignored.handleMessage
in interface org.springframework.messaging.MessageHandler
message
- The message containing the event to publishprotected EventMessage<?> transformMessage(org.springframework.messaging.Message<?> message)
message
to an Axon EventMessage. This method may be
overridden to change how messages are translated between the two frameworks.message
- the Spring message to convert to an eventCopyright © 2010–2024. All rights reserved.