Top Description Methods
org.springframework.messaging.core

public Interface MessageRequestReplyOperations<D>

Known Direct Subinterfaces
org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations
Known Direct Implementers
org.springframework.messaging.core.AbstractMessagingTemplate
Type Parameters
<D>
the type of destination
Imports
java.util.Map, org.springframework.lang.Nullable, org.springframework.messaging.Message, .MessagingException

Operations for sending messages to and receiving the reply from a destination.
Authors
Mark Fisher, Rossen Stoyanchev
Since
4.0
See Also
GenericMessagingTemplate

Method Summary

Modifier and TypeMethod and Description
public <T> T

Returns:

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
convertSendAndReceive
(Object
payload for the request message to send
request
,
Class<T>
the target type to convert the payload of the reply to
targetClass
)

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, send it as a Message to a default destination, receive the reply and convert its body of the specified target class.

public <T> T

Returns:

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
convertSendAndReceive
(D
the target destination
destination
,
Object
payload for the request message to send
request
,
Class<T>
the target type to convert the payload of the reply to
targetClass
)

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, send it as a Message to the given destination, receive the reply and convert its body of the specified target class.

public <T> T

Returns:

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
convertSendAndReceive
(D
the target destination
destination
,
Object
payload for the request message to send
request
,
Map<String, Object>
the headers for the request message to send
headers
,
Class<T>
the target type to convert the payload of the reply to
targetClass
)

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, send it as a Message with the given headers, to the specified destination, receive the reply and convert its body of the specified target class.

public <T> T

Returns:

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
convertSendAndReceive
(Object
payload for the request message to send
request
,
Class<T>
the target type to convert the payload of the reply to
targetClass
,
MessagePostProcessor
post process to apply to the request message
requestPostProcessor
)

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, apply the given post processor and send the resulting Message to a default destination, receive the reply and convert its body of the given target class.

public <T> T

Returns:

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
convertSendAndReceive
(D
the target destination
destination
,
Object
payload for the request message to send
request
,
Class<T>
the target type to convert the payload of the reply to
targetClass
,
MessagePostProcessor
post process to apply to the request message
requestPostProcessor
)

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, apply the given post processor and send the resulting Message to the given destination, receive the reply and convert its body of the given target class.

public <T> T

Returns:

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout
convertSendAndReceive
(D
the target destination
destination
,
Object
payload for the request message to send
request
,
Map<String, Object> headers, Class<T>
the target type to convert the payload of the reply to
targetClass
,
MessagePostProcessor
post process to apply to the request message
requestPostProcessor
)

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers, apply the given post processor and send the resulting Message to the specified destination, receive the reply and convert its body of the given target class.

public Message<?>

Returns:

the reply, possibly null if the message could not be received, for example due to a timeout
sendAndReceive
(Message<?>
the message to send
requestMessage
)

Send a request message and receive the reply from a default destination.

public Message<?>

Returns:

the reply, possibly null if the message could not be received, for example due to a timeout
sendAndReceive
(D
the target destination
destination
,
Message<?>
the message to send
requestMessage
)

Send a request message and receive the reply from the given destination.

Method Detail

convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(Object request, Class<T> targetClass) throws MessagingException

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, send it as a Message to a default destination, receive the reply and convert its body of the specified target class.

Parameters
request:Object

payload for the request message to send

targetClass:Class<T>

the target type to convert the payload of the reply to

Returns:T

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(D destination, Object request, Class<T> targetClass) throws MessagingException

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, send it as a Message to the given destination, receive the reply and convert its body of the specified target class.

Parameters
destination:D

the target destination

request:Object

payload for the request message to send

targetClass:Class<T>

the target type to convert the payload of the reply to

Returns:T

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(D destination, Object request, Map<String, Object> headers, Class<T> targetClass) throws MessagingException

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, send it as a Message with the given headers, to the specified destination, receive the reply and convert its body of the specified target class.

Parameters
destination:D

the target destination

request:Object

payload for the request message to send

headers:Map<String, Object>

the headers for the request message to send

targetClass:Class<T>

the target type to convert the payload of the reply to

Returns:T

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(Object request, Class<T> targetClass, MessagePostProcessor requestPostProcessor) throws MessagingException

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, apply the given post processor and send the resulting Message to a default destination, receive the reply and convert its body of the given target class.

Parameters
request:Object

payload for the request message to send

targetClass:Class<T>

the target type to convert the payload of the reply to

requestPostProcessor:MessagePostProcessor

post process to apply to the request message

Returns:T

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(D destination, Object request, Class<T> targetClass, MessagePostProcessor requestPostProcessor) throws MessagingException

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, apply the given post processor and send the resulting Message to the given destination, receive the reply and convert its body of the given target class.

Parameters
destination:D

the target destination

request:Object

payload for the request message to send

targetClass:Class<T>

the target type to convert the payload of the reply to

requestPostProcessor:MessagePostProcessor

post process to apply to the request message

Returns:T

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(D destination, Object request, Map<String, Object> headers, Class<T> targetClass, MessagePostProcessor requestPostProcessor) throws MessagingException

Convert the given request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers, apply the given post processor and send the resulting Message to the specified destination, receive the reply and convert its body of the given target class.

Parameters
destination:D

the target destination

request:Object

payload for the request message to send

targetClass:Class<T>

the target type to convert the payload of the reply to

requestPostProcessor:MessagePostProcessor

post process to apply to the request message

Returns:T

the payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
sendAndReceiveback to summary
public Message<?> sendAndReceive(Message<?> requestMessage) throws MessagingException

Send a request message and receive the reply from a default destination.

Parameters
requestMessage:Message<?>

the message to send

Returns:Message<?>

the reply, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable
sendAndReceiveback to summary
public Message<?> sendAndReceive(D destination, Message<?> requestMessage) throws MessagingException

Send a request message and receive the reply from the given destination.

Parameters
destination:D

the target destination

requestMessage:Message<?>

the message to send

Returns:Message<?>

the reply, possibly null if the message could not be received, for example due to a timeout

Annotations
@Nullable