org.axonframework.eventhandling.amqp.spring
Class ClusterMessageListener
java.lang.Object
org.axonframework.eventhandling.amqp.spring.ClusterMessageListener
- All Implemented Interfaces:
- org.springframework.amqp.core.MessageListener
public class ClusterMessageListener
- extends Object
- implements org.springframework.amqp.core.MessageListener
MessageListener implementation that deserializes incoming messages and forwards them to one or more clusters. The
byte[]
making up the message payload must the format as used by the SpringAMQPTerminal
.
- Since:
- 2.0
- Author:
- Allard Buijze
Constructor Summary |
ClusterMessageListener(Cluster initialCluster,
AMQPMessageConverter messageConverter)
Initializes a ClusterMessageListener with given initialCluster that uses given
serializer to deserialize the message's contents into an EventMessage. |
Method Summary |
void |
addCluster(Cluster cluster)
Registers an additional cluster. |
void |
onMessage(org.springframework.amqp.core.Message message)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClusterMessageListener
public ClusterMessageListener(Cluster initialCluster,
AMQPMessageConverter messageConverter)
- Initializes a ClusterMessageListener with given
initialCluster
that uses given
serializer
to deserialize the message's contents into an EventMessage.
- Parameters:
initialCluster
- The first cluster to assign to the listenermessageConverter
- The message converter to use to convert AMQP Messages to Event Messages
onMessage
public void onMessage(org.springframework.amqp.core.Message message)
- Specified by:
onMessage
in interface org.springframework.amqp.core.MessageListener
addCluster
public void addCluster(Cluster cluster)
- Registers an additional cluster. This cluster will receive messages once registered.
- Parameters:
cluster
- the cluster to add to the listener
Copyright © 2010-2016. All Rights Reserved.