Class MappingUtils
java.lang.Object
org.springframework.integration.amqp.support.MappingUtils
public final class MappingUtils extends Object
Utility methods used during message mapping.
- Since:
- 4.3
- Author:
- Gary Russell, Artem Bilan
-
Method Summary
Modifier and Type Method Description static void
checkDeliveryMode(Message<?> requestMessage, MessageProperties messageProperties, MessageDeliveryMode defaultDeliveryMode)
Check the delivery mode and update with the default if not already present.static Message
mapMessage(Message<?> requestMessage, MessageConverter converter, AmqpHeaderMapper headerMapper, MessageDeliveryMode defaultDeliveryMode, boolean headersMappedLast)
Map an o.s.m.Message to an o.s.a.core.Message.static Message
mapReplyMessage(Message<?> replyMessage, MessageConverter converter, AmqpHeaderMapper headerMapper, MessageDeliveryMode defaultDeliveryMode, boolean headersMappedLast)
Map a reply o.s.m.Message to an o.s.a.core.Message.
-
Method Details
-
mapMessage
public static Message mapMessage(Message<?> requestMessage, MessageConverter converter, AmqpHeaderMapper headerMapper, MessageDeliveryMode defaultDeliveryMode, boolean headersMappedLast)Map an o.s.m.Message to an o.s.a.core.Message. When using aContentTypeDelegatingMessageConverter
,AmqpHeaders.CONTENT_TYPE
andMessageHeaders.CONTENT_TYPE
will be used for the selection, with the AMQP header taking precedence.- Parameters:
requestMessage
- the request message.converter
- the message converter to use.headerMapper
- the header mapper to use.defaultDeliveryMode
- the default delivery mode.headersMappedLast
- true if headers are mapped after conversion.- Returns:
- the mapped Message.
-
mapReplyMessage
public static Message mapReplyMessage(Message<?> replyMessage, MessageConverter converter, AmqpHeaderMapper headerMapper, MessageDeliveryMode defaultDeliveryMode, boolean headersMappedLast)Map a reply o.s.m.Message to an o.s.a.core.Message. When using aContentTypeDelegatingMessageConverter
,AmqpHeaders.CONTENT_TYPE
andMessageHeaders.CONTENT_TYPE
will be used for the selection, with the AMQP header taking precedence.- Parameters:
replyMessage
- the reply message.converter
- the message converter to use.headerMapper
- the header mapper to use.defaultDeliveryMode
- the default delivery mode.headersMappedLast
- true if headers are mapped after conversion.- Returns:
- the mapped Message.
- Since:
- 5.1.9
-
checkDeliveryMode
public static void checkDeliveryMode(Message<?> requestMessage, MessageProperties messageProperties, @Nullable MessageDeliveryMode defaultDeliveryMode)Check the delivery mode and update with the default if not already present.- Parameters:
requestMessage
- the request message.messageProperties
- the mapped message properties.defaultDeliveryMode
- the default delivery mode.
-