public class DefaultAMQPMessageConverter extends Object implements AMQPMessageConverter
Constructor and Description |
---|
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 . |
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 DefaultAMQPMessageConverter(Serializer serializer)
serializer
, using a PackageRoutingKeyResolver
and requesting durable dispatching.serializer
- The serializer to serialize the Event Message's payload withpublic DefaultAMQPMessageConverter(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–2018. All rights reserved.