Top Description Methods
org.springframework.jms.support.converter

public Interface SmartMessageConverter

extends MessageConverter
Known Direct Implementers
org.springframework.jms.support.converter.MappingJackson2MessageConverter
Imports
jakarta.jms.JMSException, .Message, .Session, org.springframework.lang.Nullable

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.

Author
Stephane Nicoll
Since
4.3

Method Summary

Modifier and TypeMethod and Description
public Message

Returns:

the JMS Message
toMessage
(Object
the object to convert
object
,
Session
the Session to use for creating a JMS Message
session
,
Object
an extra object passed to the MessageConverter, e.g. the associated MethodParameter (may be null}
conversionHint
)

A variant of toMessage(Object, Session) which takes an extra conversion context as an argument, allowing to take e.g. annotations on a payload parameter into account.

Inherited from org.springframework.jms.support.converter.MessageConverter:
fromMessagetoMessage

Method Detail

toMessageback to summary
public Message toMessage(Object object, Session session, Object conversionHint) throws JMSException, MessageConversionException

A variant of toMessage(Object, Session) which takes an extra conversion context as an argument, allowing to take e.g. annotations on a payload parameter into account.

Parameters
object:Object

the object to convert

session:Session

the Session to use for creating a JMS Message

conversionHint:Object

an extra object passed to the MessageConverter, e.g. the associated MethodParameter (may be null}

Returns:Message

the JMS Message

Exceptions
JMSException:
if thrown by JMS API methods
MessageConversionException:
in case of conversion failure
See Also
toMessage(Object, Session)