public abstract class AbstractMessagingTemplate<D> extends AbstractMessageSendingTemplate<D> implements MessageRequestReplyOperations<D>, MessageReceivingOperations<D>
AbstractMessageSendingTemplate that adds support for
receive as well as request-reply style operations as defined by
MessageReceivingOperations and MessageRequestReplyOperations.logger| Constructor and Description |
|---|
AbstractMessagingTemplate() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
convertSendAndReceive(D destination,
Object request,
Class<T> targetClass)
Convert the given request Object to serialized form, possibly using a
MessageConverter, send
it as a Message 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 postProcessor)
Convert the given request Object to serialized form, possibly using a
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. |
<T> T |
convertSendAndReceive(D destination,
Object request,
Map<String,Object> headers,
Class<T> targetClass)
Convert the given request Object to serialized form, possibly using a
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. |
<T> T |
convertSendAndReceive(D destination,
Object request,
Map<String,Object> headers,
Class<T> targetClass,
MessagePostProcessor postProcessor)
Convert the given request Object to serialized form, possibly using a
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. |
<T> T |
convertSendAndReceive(Object request,
Class<T> targetClass)
Convert the given request Object to serialized form, possibly using a
MessageConverter, send
it as a Message 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 postProcessor)
Convert the given request Object to serialized form, possibly using a
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. |
protected abstract Message<?> |
doReceive(D destination) |
protected abstract Message<?> |
doSendAndReceive(D destination,
Message<?> requestMessage) |
Message<?> |
receive()
Receive a message from a default destination.
|
Message<?> |
receive(D destination)
Receive a message from the given destination.
|
<T> T |
receiveAndConvert(Class<T> targetClass)
Receive a message from a default destination and convert its payload to the
specified target class.
|
<T> T |
receiveAndConvert(D destination,
Class<T> targetClass)
Receive a message from the given destination and convert its payload to the
specified 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.
|
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, doSend, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, processHeadersToSend, send, send, setDefaultDestination, setMessageConverterpublic Message<?> receive()
MessageReceivingOperationsreceive in interface MessageReceivingOperations<D>null if the message could not
be received, for example due to a timeoutpublic Message<?> receive(D destination)
MessageReceivingOperationsreceive in interface MessageReceivingOperations<D>destination - the target destinationnull if the message could not
be received, for example due to a timeoutpublic <T> T receiveAndConvert(Class<T> targetClass)
MessageReceivingOperationsreceiveAndConvert in interface MessageReceivingOperations<D>targetClass - the target class to convert the payload tonull if
the message could not be received, for example due to a timeoutpublic <T> T receiveAndConvert(D destination, Class<T> targetClass)
MessageReceivingOperationsreceiveAndConvert in interface MessageReceivingOperations<D>destination - the target destinationtargetClass - the target class to convert the payload tonull if
the message could not be received, for example due to a timeoutpublic Message<?> sendAndReceive(Message<?> requestMessage)
MessageRequestReplyOperationssendAndReceive in interface MessageRequestReplyOperations<D>requestMessage - the message to sendnull if the message could not be received,
for example due to a timeoutpublic Message<?> sendAndReceive(D destination, Message<?> requestMessage)
MessageRequestReplyOperationssendAndReceive in interface MessageRequestReplyOperations<D>destination - the target destinationrequestMessage - the message to sendnull if the message could not be received,
for example due to a timeoutprotected abstract Message<?> doSendAndReceive(D destination, Message<?> requestMessage)
public <T> T convertSendAndReceive(Object request, Class<T> targetClass)
MessageRequestReplyOperationsMessageConverter, send
it as a Message to a default destination, receive the reply and convert
its body of the specified target class.convertSendAndReceive in interface MessageRequestReplyOperations<D>request - payload for the request message to sendtargetClass - the target type to convert the payload of the reply tonull if the message
could not be received, for example due to a timeoutpublic <T> T convertSendAndReceive(D destination, Object request, Class<T> targetClass)
MessageRequestReplyOperationsMessageConverter, send
it as a Message to the given destination, receive the reply and convert
its body of the specified target class.convertSendAndReceive in interface MessageRequestReplyOperations<D>destination - the target destinationrequest - payload for the request message to sendtargetClass - the target type to convert the payload of the reply tonull if the message
could not be received, for example due to a timeoutpublic <T> T convertSendAndReceive(D destination, Object request, Map<String,Object> headers, Class<T> targetClass)
MessageRequestReplyOperationsMessageConverter, 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.convertSendAndReceive in interface MessageRequestReplyOperations<D>destination - the target destinationrequest - payload for the request message to sendheaders - headers for the request message to sendtargetClass - the target type to convert the payload of the reply tonull if the message
could not be received, for example due to a timeoutpublic <T> T convertSendAndReceive(Object request, Class<T> targetClass, MessagePostProcessor postProcessor)
MessageRequestReplyOperationsMessageConverter,
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.convertSendAndReceive in interface MessageRequestReplyOperations<D>request - payload for the request message to sendtargetClass - the target type to convert the payload of the reply topostProcessor - post process to apply to the request messagenull if the message
could not be received, for example due to a timeoutpublic <T> T convertSendAndReceive(D destination, Object request, Class<T> targetClass, MessagePostProcessor postProcessor)
MessageRequestReplyOperationsMessageConverter,
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.convertSendAndReceive in interface MessageRequestReplyOperations<D>destination - the target destinationrequest - payload for the request message to sendtargetClass - the target type to convert the payload of the reply topostProcessor - post process to apply to the request messagenull if the message
could not be received, for example due to a timeoutpublic <T> T convertSendAndReceive(D destination, Object request, Map<String,Object> headers, Class<T> targetClass, MessagePostProcessor postProcessor)
MessageRequestReplyOperationsMessageConverter,
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.convertSendAndReceive in interface MessageRequestReplyOperations<D>destination - the target destinationrequest - payload for the request message to sendtargetClass - the target type to convert the payload of the reply topostProcessor - post process to apply to the request messagenull if the message
could not be received, for example due to a timeout