Interface DestinationResolvingMessageRequestReplyOperations<D>
- Type Parameters:
D
- the destination type
- All Superinterfaces:
MessageRequestReplyOperations<D>
- All Known Implementing Classes:
AbstractDestinationResolvingMessagingTemplate
,GenericMessagingTemplate
public interface DestinationResolvingMessageRequestReplyOperations<D>
extends MessageRequestReplyOperations<D>
Extends
MessageRequestReplyOperations
and adds operations for sending and
receiving messages to and from a destination specified as a (resolvable) String name.- Since:
- 4.0
- Author:
- Mark Fisher, Rossen Stoyanchev
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T> T
convertSendAndReceive
(String destinationName, Object request, Class<T> targetClass) Resolve the given destination name, convert the payload request Object to serialized form, possibly using aMessageConverter
, wrap it as a message and send it to the resolved destination, receive a reply and convert its body to the specified target class.<T> T
convertSendAndReceive
(String destinationName, Object request, Class<T> targetClass, MessagePostProcessor requestPostProcessor) Resolve the given destination name, convert the payload request Object to serialized form, possibly using aMessageConverter
, wrap it as a message, apply the given post process, and send the resulting message to the resolved destination, then receive a reply and convert its body to the specified target class.<T> T
convertSendAndReceive
(String destinationName, Object request, Map<String, Object> headers, Class<T> targetClass) Resolve the given destination name, convert the payload request Object to serialized form, possibly using aMessageConverter
, wrap it as a message with the given headers and send it to the resolved destination, receive a reply and convert its body to the specified target class.<T> T
convertSendAndReceive
(String destinationName, Object request, Map<String, Object> headers, Class<T> targetClass, MessagePostProcessor requestPostProcessor) Resolve the given destination name, convert the payload request Object to serialized form, possibly using aMessageConverter
, wrap it as a message with the given headers, apply the given post process, and send the resulting message to the resolved destination, then receive a reply and convert its body to the specified target class.Message<?>
sendAndReceive
(String destinationName, Message<?> requestMessage) Resolve the given destination name to a destination and send the given message, receive a reply and return it.Methods inherited from interface org.springframework.messaging.core.MessageRequestReplyOperations
convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceive, sendAndReceive
-
Method Details
-
sendAndReceive
@Nullable Message<?> sendAndReceive(String destinationName, Message<?> requestMessage) throws MessagingException Resolve the given destination name to a destination and send the given message, receive a reply and return it.- Parameters:
destinationName
- the name of the target destinationrequestMessage
- the message to send- Returns:
- the received message, possibly
null
if the message could not be received, for example due to a timeout - Throws:
MessagingException
-
convertSendAndReceive
@Nullable <T> T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass) throws MessagingException Resolve the given destination name, convert the payload request Object to serialized form, possibly using aMessageConverter
, wrap it as a message and send it to the resolved destination, receive a reply and convert its body to the specified target class.- Parameters:
destinationName
- the name of the target destinationrequest
- the payload for the request message to sendtargetClass
- the target class to convert the payload of the reply to- Returns:
- the converted payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - Throws:
MessagingException
-
convertSendAndReceive
@Nullable <T> T convertSendAndReceive(String destinationName, Object request, @Nullable Map<String, Object> headers, Class<T> targetClass) throws MessagingExceptionResolve the given destination name, convert the payload request Object to serialized form, possibly using aMessageConverter
, wrap it as a message with the given headers and send it to the resolved destination, receive a reply and convert its body to the specified target class.- Parameters:
destinationName
- the name of the target destinationrequest
- the payload for the request message to sendheaders
- the headers for the request message to sendtargetClass
- the target class to convert the payload of the reply to- Returns:
- the converted payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - Throws:
MessagingException
-
convertSendAndReceive
@Nullable <T> T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass, @Nullable MessagePostProcessor requestPostProcessor) throws MessagingException Resolve the given destination name, convert the payload request Object to serialized form, possibly using aMessageConverter
, wrap it as a message, apply the given post process, and send the resulting message to the resolved destination, then receive a reply and convert its body to the specified target class.- Parameters:
destinationName
- the name of the target destinationrequest
- the payload for the request message to sendtargetClass
- the target class to convert the payload of the reply torequestPostProcessor
- post process for the request message- Returns:
- the converted payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - Throws:
MessagingException
-
convertSendAndReceive
@Nullable <T> T convertSendAndReceive(String destinationName, Object request, @Nullable Map<String, Object> headers, Class<T> targetClass, @Nullable MessagePostProcessor requestPostProcessor) throws MessagingExceptionResolve the given destination name, convert the payload request Object to serialized form, possibly using aMessageConverter
, wrap it as a message with the given headers, apply the given post process, and send the resulting message to the resolved destination, then receive a reply and convert its body to the specified target class.- Parameters:
destinationName
- the name of the target destinationrequest
- the payload for the request message to sendheaders
- the headers for the request message to sendtargetClass
- the target class to convert the payload of the reply torequestPostProcessor
- post process for the request message- Returns:
- the converted payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout - Throws:
MessagingException
-