org.axonframework.eventhandling.amqp
Class DefaultAMQPMessageConverter

java.lang.Object
  extended by org.axonframework.eventhandling.amqp.DefaultAMQPMessageConverter
All Implemented Interfaces:
AMQPMessageConverter

public class DefaultAMQPMessageConverter
extends Object
implements AMQPMessageConverter

Default implementation of the AMQPMessageConverter interface. This implementation will suffice in most cases, unless very specific requirements exist about the content of an AMQP Message's body. For example with using the Message Broker to interact with non-Axon based applications.

Since:
2.0
Author:
Allard Buijze

Constructor Summary
DefaultAMQPMessageConverter(Serializer serializer)
          Initializes the AMQPMessageConverter with the given serializer, using a PackageRoutingKeyResolver and requesting durable dispatching.
DefaultAMQPMessageConverter(Serializer serializer, RoutingKeyResolver routingKeyResolver, boolean durable)
          Initializes the AMQPMessageConverter with the given serializer, routingKeyResolver and requesting durable dispatching when durable is true.
 
Method Summary
 AMQPMessage createAMQPMessage(EventMessage eventMessage)
          Creates an AMQPMessage from given eventMessage.
 EventMessage readAMQPMessage(byte[] messageBody, Map<String,Object> headers)
          Reconstruct an EventMessage from the given messageBody and headers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAMQPMessageConverter

public DefaultAMQPMessageConverter(Serializer serializer)
Initializes the AMQPMessageConverter with the given serializer, using a PackageRoutingKeyResolver and requesting durable dispatching.

Parameters:
serializer - The serializer to serialize the Event Message's payload and Meta Data with

DefaultAMQPMessageConverter

public DefaultAMQPMessageConverter(Serializer serializer,
                                   RoutingKeyResolver routingKeyResolver,
                                   boolean durable)
Initializes the AMQPMessageConverter with the given serializer, routingKeyResolver and requesting durable dispatching when durable is true.

Parameters:
serializer - The serializer to serialize the Event Message's payload and Meta Data with
routingKeyResolver - The strategy to use to resolve routing keys for Event Messages
durable - Whether to request durable message dispatching
Method Detail

createAMQPMessage

public AMQPMessage createAMQPMessage(EventMessage eventMessage)
Description copied from interface: AMQPMessageConverter
Creates an AMQPMessage from given eventMessage.

Specified by:
createAMQPMessage in interface AMQPMessageConverter
Parameters:
eventMessage - The EventMessage to create the AMQP Message from
Returns:
an AMQP Message containing the data and characteristics of the Message to send to the AMQP Message Broker.

readAMQPMessage

public EventMessage readAMQPMessage(byte[] messageBody,
                                    Map<String,Object> headers)
Description copied from interface: AMQPMessageConverter
Reconstruct an EventMessage from the given messageBody and headers.

Specified by:
readAMQPMessage in interface AMQPMessageConverter
Parameters:
messageBody - The body of the AMQP Message
headers - The headers attached to the AMQP Message
Returns:
The Event Message to publish on the local clusters


Copyright © 2010-2016. All Rights Reserved.