public interface

ProducerCallback

org.springframework.jms.core.ProducerCallback<T>

Class Overview

Callback for sending a message to a JMS destination.

To be used with JmsTemplate's callback methods that take a ProducerCallback argument, often implemented as an anonymous inner class.

The typical implementation will perform multiple operations on the supplied JMS Session and MessageProducer. When used with a 1.0.2 provider, you need to downcast to the appropriate domain implementation, either javax.jms.QueueSender or javax.jms.TopicPublisher, to actually send a message.

See Also
  • execute(ProducerCallback)
  • JmsTemplate#execute(javax.jms.Destination, ProducerCallback)
  • JmsTemplate#execute(String, ProducerCallback)

Summary

Public Methods
abstract T doInJms(Session session, MessageProducer producer)
Perform operations on the given Session and MessageProducer.

Public Methods

public abstract T doInJms (Session session, MessageProducer producer)

Perform operations on the given Session and MessageProducer.

The message producer is not associated with any destination unless when specified in the JmsTemplate call.

Parameters
session the JMS Session object to use
producer the JMS MessageProducer object to use
Returns
  • a result object from working with the Session, if any (can be null)
Throws
if thrown by JMS API methods
JMSException