Top Description Constructors Methods
org.springframework.messaging.core

public abstract Class AbstractMessagingTemplate<D>

extends AbstractMessageReceivingTemplate<D>
implements MessageRequestReplyOperations<D>
Class Inheritance
All Implemented Interfaces
org.springframework.messaging.core.MessageRequestReplyOperations
Known Direct Subclasses
org.springframework.messaging.core.AbstractDestinationResolvingMessagingTemplate
Type Parameters
<D>
the destination type
Imports
java.util.Map, org.springframework.lang.Nullable, org.springframework.messaging.Message

An extension of AbstractMessageReceivingTemplate that adds support for request-reply style operations as defined by MessageRequestReplyOperations.
Authors
Mark Fisher, Rossen Stoyanchev, Stephane Nicoll
Since
4.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <T> T
convertSendAndReceive(Object
payload for the request message to send
request
,
Class<T>
the target type to convert the payload of the reply to
targetClass
)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

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
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
)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

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
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
)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

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
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
postProcessor
)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

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
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
postProcessor
)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

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
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
postProcessor
)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

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.
protected abstract Message<?>
doSendAndReceive(D destination, Message<?> requestMessage)

public Message<?>
sendAndReceive(Message<?>
the message to send
requestMessage
)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.sendAndReceive.

Send a request message and receive the reply from a default destination.
public Message<?>
sendAndReceive(D
the target destination
destination
,
Message<?>
the message to send
requestMessage
)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.sendAndReceive.

Send a request message and receive the reply from the given destination.
Inherited from org.springframework.messaging.core.AbstractMessageReceivingTemplate:
doConvertdoReceivereceivereceivereceiveAndConvertreceiveAndConvert

Constructor Detail

AbstractMessagingTemplateback to summary
public AbstractMessagingTemplate()

Method Detail

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

Implements org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Doc from org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

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
@Override
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(D destination, Object request, Class<T> targetClass)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Doc from org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

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
@Override
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(D destination, Object request, Map<String, Object> headers, Class<T> targetClass)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Doc from org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

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
@Override
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(Object request, Class<T> targetClass, MessagePostProcessor postProcessor)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Doc from org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

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

postProcessor: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
@Override
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(D destination, Object request, Class<T> targetClass, MessagePostProcessor postProcessor)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Doc from org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

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

postProcessor: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
@Override
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(D destination, Object request, Map<String, Object> headers, Class<T> targetClass, MessagePostProcessor postProcessor)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Doc from org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

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

postProcessor: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
@SuppressWarnings:unchecked
@Override
@Nullable
doSendAndReceiveback to summary
protected abstract Message<?> doSendAndReceive(D destination, Message<?> requestMessage)
Annotations
@Nullable
sendAndReceiveback to summary
public Message<?> sendAndReceive(Message<?> requestMessage)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.sendAndReceive.

Doc from org.springframework.messaging.core.MessageRequestReplyOperations.sendAndReceive.

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
@Override
@Nullable
sendAndReceiveback to summary
public Message<?> sendAndReceive(D destination, Message<?> requestMessage)

Implements org.springframework.messaging.core.MessageRequestReplyOperations.sendAndReceive.

Doc from org.springframework.messaging.core.MessageRequestReplyOperations.sendAndReceive.

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
@Override
@Nullable