Interface ProducerCallback<T>
- Type Parameters:
T- the result type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
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.
- since:
- 1.1
- Author:
- Mark Pollack
- see Also:
-
Method summary
-
Method Details
-
doInJms
@Nullable T doInJms(jakarta.jms.session session, jakarta.jms.MessageProducer producer) throws jakarta.jms.JMsException Perform operations on the givensessionandMessageProducer.The message producer is not associated with any destination unless when specified in the JmsTemplate call.
- Parameters:
session- the JMssessionobject to useproducer- the JMsMessageProducerobject to use- Returns:
- a result object from working with the
session, if any (ornullif none) - Throws:
jakarta.jms.JMsException- if thrown by JMs API methods
-