spring-framework / org.springframework.jms.core / ProducerCallback

ProducerCallback

@FunctionalInterface interface ProducerCallback<T : Any>

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 or as a lambda expression.

The typical implementation will perform multiple operations on the supplied JMS Session and MessageProducer.

Author
Mark Pollack

Since
1.1

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

Functions

doInJms

abstract fun doInJms(session: Session, producer: MessageProducer): T

Perform operations on the given Session and MessageProducer.

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