public class JavaSerializationAMQPMessageConverter extends Object implements AMQPMessageConverter
This class is not the recommended approach, as it doesn't play well with non-axon consumers. It is available for backwards compatibility reasons, as this implementation was the default in Axon 2.
Constructor and Description |
---|
JavaSerializationAMQPMessageConverter(Serializer serializer)
Initializes the AMQPMessageConverter with the given
serializer , using a PackageRoutingKeyResolver and requesting durable dispatching. |
JavaSerializationAMQPMessageConverter(Serializer serializer,
RoutingKeyResolver routingKeyResolver,
boolean durable)
Initializes the AMQPMessageConverter with the given
serializer , routingKeyResolver and
requesting durable dispatching when durable is true . |
Modifier and Type | Method and Description |
---|---|
AMQPMessage |
createAMQPMessage(EventMessage eventMessage)
Creates an AMQPMessage from given
eventMessage . |
Optional<EventMessage<?>> |
readAMQPMessage(byte[] messageBody,
Map<String,Object> headers)
Reconstruct an EventMessage from the given
messageBody and headers . |
public JavaSerializationAMQPMessageConverter(Serializer serializer)
serializer
, using a PackageRoutingKeyResolver
and requesting durable dispatching.serializer
- The serializer to serialize the Event Message's payload and Meta Data withpublic JavaSerializationAMQPMessageConverter(Serializer serializer, RoutingKeyResolver routingKeyResolver, boolean durable)
serializer
, routingKeyResolver
and
requesting durable dispatching when durable
is true
.serializer
- The serializer to serialize the Event Message's payload and Meta Data withroutingKeyResolver
- The strategy to use to resolve routing keys for Event Messagesdurable
- Whether to request durable message dispatchingpublic AMQPMessage createAMQPMessage(EventMessage eventMessage)
AMQPMessageConverter
eventMessage
.createAMQPMessage
in interface AMQPMessageConverter
eventMessage
- The EventMessage to create the AMQP Message frompublic Optional<EventMessage<?>> readAMQPMessage(byte[] messageBody, Map<String,Object> headers)
AMQPMessageConverter
messageBody
and headers
. The returned optional
resolves to a message if the given input parameters represented a correct event message.readAMQPMessage
in interface AMQPMessageConverter
messageBody
- The body of the AMQP Messageheaders
- The headers attached to the AMQP MessageCopyright © 2010–2017. All rights reserved.