接口 ProducerCallback<T>
- 类型参数:
T- the result type
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface public interface ProducerCallback<T>
Callback for sending a message to a JMS destination.To be used with
JmsTemplate's callback methods that take aProducerCallbackargument, often implemented as an anonymous inner class or as a lambda expression.The typical implementation will perform multiple operations on the supplied JMS
SessionandMessageProducer.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 TdoInJms(Session session, MessageProducer producer)Perform operations on the givenSessionandMessageProducer.
方法详细资料
doInJms
@Nullable T doInJms(Session session, MessageProducer producer) throws JMSException
Perform operations on the givenSessionandMessageProducer.The message producer is not associated with any destination unless when specified in the JmsTemplate call.
- 参数:
session- the JMSSessionobject to useproducer- the JMSMessageProducerobject to use- 返回:
- a result object from working with the
Session, if any (ornullif none) - 抛出:
JMSException- if thrown by JMS API methods