public interface

SessionAwareMessageListener

org.springframework.jms.listener.SessionAwareMessageListener<M extends Message>
Known Indirect Subclasses

Class Overview

Variant of the standard JMS javax.jms.MessageListener 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 and SimpleMessageListenerContainer, 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.

Summary

Public Methods
abstract void onMessage(M message, Session session)
Callback for processing a received JMS message.

Public Methods

public abstract void onMessage (M message, Session session)

Callback for processing a received JMS message.

Implementors are supposed to process the given Message, typically sending reply messages through the given Session.

Parameters
message the received JMS message (never null)
session the underlying JMS Session (never null)
Throws
if thrown by JMS methods
JMSException