接口 MessageRequestReplyOperations<D>
- 类型参数:
D
- the type of destination
- 所有已知实现类:
AbstractDestinationResolvingMessagingTemplate
,AbstractMessagingTemplate
,GenericMessagingTemplate
,JmsMessagingTemplate
public interface MessageRequestReplyOperations<D>
Operations for sending messages to and receiving the reply from a destination.- 从以下版本开始:
- 4.0
- 作者:
- Mark Fisher, Rossen Stoyanchev
- 另请参阅:
GenericMessagingTemplate
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 <T> T
convertSendAndReceive(D destination, Object request, Class<T> targetClass)
Convert the given request Object to serialized form, possibly using aMessageConverter
, send it as aMessage
to the given destination, receive the reply and convert its body of the specified target class.<T> T
convertSendAndReceive(D destination, Object request, Class<T> targetClass, MessagePostProcessor requestPostProcessor)
Convert the given request Object to serialized form, possibly using aMessageConverter
, apply the given post processor and send the resultingMessage
to the given destination, receive the reply and convert its body of the given target class.<T> T
convertSendAndReceive(D destination, Object request, Map<String,Object> headers, Class<T> targetClass)
Convert the given request Object to serialized form, possibly using aMessageConverter
, send it as aMessage
with the given headers, to the specified destination, receive the reply and convert its body of the specified target class.<T> T
convertSendAndReceive(D destination, Object request, Map<String,Object> headers, Class<T> targetClass, MessagePostProcessor requestPostProcessor)
Convert the given request Object to serialized form, possibly using aMessageConverter
, wrap it as a message with the given headers, apply the given post processor and send the resultingMessage
to the specified destination, receive the reply and convert its body of the given target class.<T> T
convertSendAndReceive(Object request, Class<T> targetClass)
Convert the given request Object to serialized form, possibly using aMessageConverter
, send it as aMessage
to a default destination, receive the reply and convert its body of the specified target class.<T> T
convertSendAndReceive(Object request, Class<T> targetClass, MessagePostProcessor requestPostProcessor)
Convert the given request Object to serialized form, possibly using aMessageConverter
, apply the given post processor and send the resultingMessage
to a default destination, receive the reply and convert its body of the given target class.Message<?>
sendAndReceive(D destination, Message<?> requestMessage)
Send a request message and receive the reply from the given destination.Message<?>
sendAndReceive(Message<?> requestMessage)
Send a request message and receive the reply from a default destination.
方法详细资料
sendAndReceive
@Nullable Message<?> sendAndReceive(Message<?> requestMessage) throws MessagingException
Send a request message and receive the reply from a default destination.- 参数:
requestMessage
- the message to send- 返回:
- the reply, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
sendAndReceive
@Nullable Message<?> sendAndReceive(D destination, Message<?> requestMessage) throws MessagingException
Send a request message and receive the reply from the given destination.- 参数:
destination
- the target destinationrequestMessage
- the message to send- 返回:
- the reply, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
convertSendAndReceive
@Nullable <T> T convertSendAndReceive(Object request, Class<T> targetClass) throws MessagingException
Convert the given request Object to serialized form, possibly using aMessageConverter
, send it as aMessage
to a default destination, receive the reply and convert its body of the specified target class.- 参数:
request
- payload for the request message to sendtargetClass
- the target type to convert the payload of the reply to- 返回:
- the payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
convertSendAndReceive
@Nullable <T> T convertSendAndReceive(D destination, Object request, Class<T> targetClass) throws MessagingException
Convert the given request Object to serialized form, possibly using aMessageConverter
, send it as aMessage
to the given destination, receive the reply and convert its body of the specified target class.- 参数:
destination
- the target destinationrequest
- payload for the request message to sendtargetClass
- the target type to convert the payload of the reply to- 返回:
- the payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
convertSendAndReceive
@Nullable <T> T convertSendAndReceive(D destination, Object request, @Nullable Map<String,Object> headers, Class<T> targetClass) throws MessagingException
Convert the given request Object to serialized form, possibly using aMessageConverter
, send it as aMessage
with the given headers, to the specified destination, receive the reply and convert its body of the specified target class.- 参数:
destination
- the target destinationrequest
- payload for the request message to sendheaders
- the headers for the request message to sendtargetClass
- the target type to convert the payload of the reply to- 返回:
- the payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
convertSendAndReceive
@Nullable <T> T convertSendAndReceive(Object request, Class<T> targetClass, @Nullable MessagePostProcessor requestPostProcessor) throws MessagingException
Convert the given request Object to serialized form, possibly using aMessageConverter
, apply the given post processor and send the resultingMessage
to a default destination, receive the reply and convert its body of the given target class.- 参数:
request
- payload for the request message to sendtargetClass
- the target type to convert the payload of the reply torequestPostProcessor
- post process to apply to the request message- 返回:
- the payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
convertSendAndReceive
@Nullable <T> T convertSendAndReceive(D destination, Object request, Class<T> targetClass, MessagePostProcessor requestPostProcessor) throws MessagingException
Convert the given request Object to serialized form, possibly using aMessageConverter
, apply the given post processor and send the resultingMessage
to the given destination, receive the reply and convert its body of the given target class.- 参数:
destination
- the target destinationrequest
- payload for the request message to sendtargetClass
- the target type to convert the payload of the reply torequestPostProcessor
- post process to apply to the request message- 返回:
- the payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException
convertSendAndReceive
@Nullable <T> T convertSendAndReceive(D destination, Object request, @Nullable Map<String,Object> headers, Class<T> targetClass, @Nullable MessagePostProcessor requestPostProcessor) throws MessagingException
Convert the given request Object to serialized form, possibly using aMessageConverter
, wrap it as a message with the given headers, apply the given post processor and send the resultingMessage
to the specified destination, receive the reply and convert its body of the given target class.- 参数:
destination
- the target destinationrequest
- payload for the request message to sendtargetClass
- the target type to convert the payload of the reply torequestPostProcessor
- post process to apply to the request message- 返回:
- the payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - 抛出:
MessagingException