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
,
InvocableHandlerMethod
logger
Constructor and Description |
---|
MessagingMessageListenerAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
onMessage(Message jmsMessage,
Session session)
Callback for processing a received JMS 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, setMessageConverter
public void setHandlerMethod(InvocableHandlerMethod handlerMethod)
InvocableHandlerMethod
to use to invoke the method
processing an incoming Message
.public void onMessage(Message jmsMessage, Session session) throws JMSException
SessionAwareMessageListener
Implementors 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 methods