Class MappingUtils
java.lang.Object
org.springframework.integration.amqp.support.MappingUtils
public final class MappingUtils
extends java.lang.Object
Utility methods used during message mapping.
- Since:
- 4.3
-
Method Summary
Modifier and Type Method Description static voidcheckDeliveryMode(org.springframework.messaging.Message<?> requestMessage, org.springframework.amqp.core.MessageProperties messageProperties, org.springframework.amqp.core.MessageDeliveryMode defaultDeliveryMode)Check the delivery mode and update with the default if not already present.static org.springframework.amqp.core.MessagemapMessage(org.springframework.messaging.Message<?> requestMessage, org.springframework.amqp.support.converter.MessageConverter converter, AmqpHeaderMapper headerMapper, org.springframework.amqp.core.MessageDeliveryMode defaultDeliveryMode, boolean headersMappedLast)Map an o.s.m.Message to an o.s.a.core.Message.static org.springframework.amqp.core.MessagemapReplyMessage(org.springframework.messaging.Message<?> replyMessage, org.springframework.amqp.support.converter.MessageConverter converter, AmqpHeaderMapper headerMapper, org.springframework.amqp.core.MessageDeliveryMode defaultDeliveryMode, boolean headersMappedLast)Map a reply o.s.m.Message to an o.s.a.core.Message.
-
Method Details
-
mapMessage
public static org.springframework.amqp.core.Message mapMessage(org.springframework.messaging.Message<?> requestMessage, org.springframework.amqp.support.converter.MessageConverter converter, AmqpHeaderMapper headerMapper, org.springframework.amqp.core.MessageDeliveryMode defaultDeliveryMode, boolean headersMappedLast)Map an o.s.m.Message to an o.s.a.core.Message. When using aContentTypeDelegatingMessageConverter,AmqpHeaders.CONTENT_TYPEandMessageHeaders.CONTENT_TYPEwill 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 org.springframework.amqp.core.Message mapReplyMessage(org.springframework.messaging.Message<?> replyMessage, org.springframework.amqp.support.converter.MessageConverter converter, AmqpHeaderMapper headerMapper, org.springframework.amqp.core.MessageDeliveryMode defaultDeliveryMode, boolean headersMappedLast)Map a reply o.s.m.Message to an o.s.a.core.Message. When using aContentTypeDelegatingMessageConverter,AmqpHeaders.CONTENT_TYPEandMessageHeaders.CONTENT_TYPEwill 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(org.springframework.messaging.Message<?> requestMessage, org.springframework.amqp.core.MessageProperties messageProperties, @Nullable org.springframework.amqp.core.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.
-