public class SpringAMQPMessageSource extends Object implements org.springframework.amqp.rabbit.core.ChannelAwareMessageListener, org.axonframework.messaging.SubscribableMessageSource<org.axonframework.eventhandling.EventMessage<?>>
The SpringAMQPMessageSource must be registered with a Spring MessageListenerContainer and forwards each message to all subscribed processors.
Note that the Processors must be subscribed before the MessageListenerContainer is started. Otherwise, messages will be consumed from the AMQP Queue without any processor processing them.
| Constructor and Description |
|---|
SpringAMQPMessageSource(AMQPMessageConverter messageConverter)
Initializes an SpringAMQPMessageSource with given
messageConverter to convert the incoming AMQP
message into an EventMessage. |
SpringAMQPMessageSource(org.axonframework.serialization.Serializer serializer)
Initializes an SpringAMQPMessageSource with
DefaultAMQPMessageConverter using given serializer. |
| Modifier and Type | Method and Description |
|---|---|
void |
onMessage(org.springframework.amqp.core.Message message,
com.rabbitmq.client.Channel channel) |
org.axonframework.common.Registration |
subscribe(Consumer<List<? extends org.axonframework.eventhandling.EventMessage<?>>> messageProcessor) |
public SpringAMQPMessageSource(org.axonframework.serialization.Serializer serializer)
DefaultAMQPMessageConverter using given serializer.serializer - The serializer to serialize payload and metadata of eventspublic SpringAMQPMessageSource(AMQPMessageConverter messageConverter)
messageConverter to convert the incoming AMQP
message into an EventMessage.messageConverter - The message converter to use to convert AMQP Messages to Event Messagespublic org.axonframework.common.Registration subscribe(Consumer<List<? extends org.axonframework.eventhandling.EventMessage<?>>> messageProcessor)
subscribe in interface org.axonframework.messaging.SubscribableMessageSource<org.axonframework.eventhandling.EventMessage<?>>public void onMessage(org.springframework.amqp.core.Message message,
com.rabbitmq.client.Channel channel)
onMessage in interface org.springframework.amqp.rabbit.core.ChannelAwareMessageListenerCopyright © 2010–2018. All rights reserved.