Class MessagingMessageListenerAdapter
java.lang.Object
org.springframework.jms.listener.adapter.AbstractAdaptableMessageListener
org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter
- All Implemented Interfaces:
MessageListener
,SessionAwareMessageListener<Message>
A
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.
- Since:
- 4.1
- Author:
- Stephane Nicoll
- See Also:
-
Message
JmsHeaderMapper
InvocableHandlerMethod
-
Field Summary
Fields inherited from class org.springframework.jms.listener.adapter.AbstractAdaptableMessageListener
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Callback for processing a received JMS message.protected Object
preProcessResponse
(Object result) Pre-process the given result before it is converted to aMessage
.void
setHandlerMethod
(org.springframework.messaging.handler.invocation.InvocableHandlerMethod handlerMethod) Set theInvocableHandlerMethod
to use to invoke the method processing an incomingMessage
.protected org.springframework.messaging.Message<?>
toMessagingMessage
(Message jmsMessage) Methods inherited from class org.springframework.jms.listener.adapter.AbstractAdaptableMessageListener
buildMessage, extractMessage, getDestinationResolver, getMessageConverter, getMessagingMessageConverter, getResponseDestination, getResponseQosSettings, handleListenerException, handleResult, onMessage, postProcessProducer, postProcessResponse, resolveDefaultResponseDestination, sendResponse, setDefaultResponseDestination, setDefaultResponseQueueName, setDefaultResponseTopicName, setDestinationResolver, setHeaderMapper, setMessageConverter, setResponseQosSettings
-
Constructor Details
-
MessagingMessageListenerAdapter
public MessagingMessageListenerAdapter()
-
-
Method Details
-
setHandlerMethod
public void setHandlerMethod(org.springframework.messaging.handler.invocation.InvocableHandlerMethod handlerMethod) Set theInvocableHandlerMethod
to use to invoke the method processing an incomingMessage
. -
onMessage
Description copied from interface:SessionAwareMessageListener
Callback for processing a received JMS message.Implementors are supposed to process the given Message, typically sending reply messages through the given Session.
- Specified by:
onMessage
in interfaceSessionAwareMessageListener<Message>
- Specified by:
onMessage
in classAbstractAdaptableMessageListener
- Parameters:
jmsMessage
- the received JMS message (nevernull
)session
- the underlying JMS Session (nevernull
)- Throws:
JMSException
- if thrown by JMS methods
-
preProcessResponse
Description copied from class:AbstractAdaptableMessageListener
Pre-process the given result before it is converted to aMessage
.- Overrides:
preProcessResponse
in classAbstractAdaptableMessageListener
- Parameters:
result
- the result of the invocation- Returns:
- the payload response to handle, either the
result
argument or any other object (for instance wrapping the result).
-
toMessagingMessage
-