Interface MessageRequestReplyOperations<D>
- Type Parameters:
D- the type of destination
- All Known Subinterfaces:
DestinationResolvingMessageRequestReplyOperations<D>,JmsMessageOperations
- All Known Implementing Classes:
AbstractDestinationResolvingMessagingTemplate,AbstractMessagingTemplate,GenericMessagingTemplate,JmsMessagingTemplate
public interface MessageRequestReplyOperations<D>
Operations for sending messages to and receiving the reply from a destination.- Since:
- 4.0
- Author:
- Mark Fisher, Rossen Stoyanchev
- See Also:
GenericMessagingTemplate
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> TconvertSendAndReceive(D destination, Object request, Class<T> targetClass)Convert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessageto the given destination, receive the reply and convert its body of the specified target class.<T> TconvertSendAndReceive(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 resultingMessageto the given destination, receive the reply and convert its body of the given target class.<T> TconvertSendAndReceive(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 aMessagewith the given headers, to the specified destination, receive the reply and convert its body of the specified target class.<T> TconvertSendAndReceive(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 resultingMessageto the specified destination, receive the reply and convert its body of the given target class.<T> TconvertSendAndReceive(Object request, Class<T> targetClass)Convert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessageto a default destination, receive the reply and convert its body of the specified target class.<T> TconvertSendAndReceive(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 resultingMessageto 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.
Method Detail
sendAndReceive
@Nullable Message<?> sendAndReceive(Message<?> requestMessage) throws MessagingException
Send a request message and receive the reply from a default destination.- Parameters:
requestMessage- the message to send- Returns:
- the reply, possibly
nullif the message could not be received, for example due to a timeout - Throws:
MessagingException
sendAndReceive
@Nullable Message<?> sendAndReceive(D destination, Message<?> requestMessage) throws MessagingException
Send a request message and receive the reply from the given destination.- Parameters:
destination- the target destinationrequestMessage- the message to send- Returns:
- the reply, possibly
nullif the message could not be received, for example due to a timeout - Throws:
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 aMessageto a default destination, receive the reply and convert its body of the specified target class.- Parameters:
request- payload for the request message to sendtargetClass- the target type to convert the payload of the reply to- Returns:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout - Throws:
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 aMessageto the given destination, receive the reply and convert its body of the specified target class.- Parameters:
destination- the target destinationrequest- payload for the request message to sendtargetClass- the target type to convert the payload of the reply to- Returns:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout - Throws:
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 aMessagewith the given headers, to the specified destination, receive the reply and convert its body of the specified target class.- Parameters:
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- Returns:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout - Throws:
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 resultingMessageto a default destination, receive the reply and convert its body of the given target class.- Parameters:
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- Returns:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout - Throws:
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 resultingMessageto the given destination, receive the reply and convert its body of the given target class.- Parameters:
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- Returns:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout - Throws:
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 resultingMessageto the specified destination, receive the reply and convert its body of the given target class.- Parameters:
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- Returns:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout - Throws:
MessagingException