public class MessagingMessageListenerAdapter extends AbstractAdaptableMessageListener
MessageListener adapter that invokes a configurable
InvocableHandlerMethod.
Wraps the incoming Message to Spring's Message
abstraction, copying the JMS standard headers using a configurable
JmsHeaderMapper.
The original Message and the Session
are provided as additional arguments so that these can be injected as
method arguments if necessary.
Message,
JmsHeaderMapper,
InvocableHandlerMethodlogger| Constructor and Description |
|---|
MessagingMessageListenerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
onMessage(Message jmsMessage,
Session session)
Callback for processing a received JMS message.
|
protected Object |
preProcessResponse(Object result)
Pre-process the given result before it is converted to a
Message. |
void |
setHandlerMethod(InvocableHandlerMethod handlerMethod)
Set the
InvocableHandlerMethod to use to invoke the method
processing an incoming Message. |
protected Message<?> |
toMessagingMessage(Message jmsMessage) |
buildMessage, extractMessage, getDestinationResolver, getMessageConverter, getMessagingMessageConverter, getResponseDestination, handleListenerException, handleResult, onMessage, postProcessProducer, postProcessResponse, resolveDefaultResponseDestination, sendResponse, setDefaultResponseDestination, setDefaultResponseQueueName, setDefaultResponseTopicName, setDestinationResolver, setHeaderMapper, setMessageConverterpublic void setHandlerMethod(InvocableHandlerMethod handlerMethod)
InvocableHandlerMethod to use to invoke the method
processing an incoming Message.public void onMessage(Message jmsMessage, Session session) throws JMSException
SessionAwareMessageListenerImplementors are supposed to process the given Message, typically sending reply messages through the given Session.
jmsMessage - the received JMS message (never null)session - the underlying JMS Session (never null)JMSException - if thrown by JMS methodsprotected Object preProcessResponse(Object result)
AbstractAdaptableMessageListenerMessage.preProcessResponse in class AbstractAdaptableMessageListenerresult - the result of the invocationresult argument
or any other object (for instance wrapping the result).