接口 SessionAwareMessageListener<M extends Message>
- 类型参数:
M
- the message type
- 所有已知实现类:
AbstractAdaptableMessageListener
,JmsInvokerServiceExporter
,MessageListenerAdapter
,MessagingMessageListenerAdapter
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface public interface SessionAwareMessageListener<M extends Message>
Variant of the standard JMSMessageListener
interface, offering not only the received Message but also the underlying JMS Session object. The latter can be used to send reply messages, without the need to access an external Connection/Session, i.e. without the need to access the underlying ConnectionFactory.Supported by Spring's
DefaultMessageListenerContainer
andSimpleMessageListenerContainer
, as direct alternative to the standard JMS MessageListener interface. Typically not supported by JCA-based listener containers: For maximum compatibility, implement a standard JMS MessageListener instead.
方法详细资料
onMessage
void onMessage(M message, Session session) throws JMSException
Callback for processing a received JMS message.Implementors are supposed to process the given Message, typically sending reply messages through the given Session.
- 参数:
message
- the received JMS message (nevernull
)session
- the underlying JMS Session (nevernull
)- 抛出:
JMSException
- if thrown by JMS methods