接口 MessageReceivingOperations<D>
- 类型参数:
D
- the type of destination to receive messages from
- 所有已知实现类:
AbstractDestinationResolvingMessagingTemplate
,AbstractMessageReceivingTemplate
,AbstractMessagingTemplate
,GenericMessagingTemplate
,JmsMessagingTemplate
public interface MessageReceivingOperations<D>
Operations for receiving messages from a destination.- 从以下版本开始:
- 4.0
- 作者:
- Mark Fisher, Rossen Stoyanchev
- 另请参阅:
GenericMessagingTemplate
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 Message<?>
receive()
Receive a message from a default destination.Message<?>
receive(D destination)
Receive a message from the given destination.<T> T
receiveAndConvert(D destination, Class<T> targetClass)
Receive a message from the given destination and convert its payload to the specified target class.<T> T
receiveAndConvert(Class<T> targetClass)
Receive a message from a default destination and convert its payload to the specified target class.
方法详细资料
receive
Message<?> receive() throws MessagingException
Receive a message from a default destination.- 返回:
- the received message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
receive
Message<?> receive(D destination) throws MessagingException
Receive a message from the given destination.- 参数:
destination
- the target destination- 返回:
- the received message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
receiveAndConvert
<T> T receiveAndConvert(Class<T> targetClass) throws MessagingException
Receive a message from a default destination and convert its payload to the specified target class.- 参数:
targetClass
- the target class to convert the payload to- 返回:
- the converted payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
receiveAndConvert
<T> T receiveAndConvert(D destination, Class<T> targetClass) throws MessagingException
Receive a message from the given destination and convert its payload to the specified target class.- 参数:
destination
- the target destinationtargetClass
- the target class to convert the payload to- 返回:
- the converted payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException