Interface SmartMessageConverter
- All Superinterfaces:
MessageConverter
- All Known Implementing Classes:
MappingJackson2MessageConverter
An extended
MessageConverter
SPI with conversion hint support.
In case of a conversion hint being provided, the framework will call
the extended method if a converter implements this interface, instead
of calling the regular toMessage
variant.
- Since:
- 4.3
- Author:
- Stephane Nicoll
-
Method Summary
Modifier and TypeMethodDescriptionA variant ofMessageConverter.toMessage(Object, Session)
which takes an extra conversion context as an argument, allowing to take, for example, annotations on a payload parameter into account.Methods inherited from interface org.springframework.jms.support.converter.MessageConverter
fromMessage, toMessage
-
Method Details
-
toMessage
Message toMessage(Object object, Session session, @Nullable Object conversionHint) throws JMSException, MessageConversionException A variant ofMessageConverter.toMessage(Object, Session)
which takes an extra conversion context as an argument, allowing to take, for example, annotations on a payload parameter into account.- Parameters:
object
- the object to convertsession
- the Session to use for creating a JMS MessageconversionHint
- an extra object passed to theMessageConverter
, for example, the associatedMethodParameter
(may benull
}- Returns:
- the JMS Message
- Throws:
JMSException
- if thrown by JMS API methodsMessageConversionException
- in case of conversion failure- See Also:
-