Interface SmartMessageConverter
- All Superinterfaces:
MessageConverter
- All Known Implementing Classes:
JacksonJsonMessageConverter, 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 TypeMethodDescriptionjakarta.jms.MessageA 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 MessageConverter
fromMessage, toMessage
-
Method Details
-
toMessage
jakarta.jms.Message toMessage(Object object, jakarta.jms.Session session, @Nullable Object conversionHint) throws jakarta.jms.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:
jakarta.jms.JMSException- if thrown by JMS API methodsMessageConversionException- in case of conversion failure- See Also:
-