public interface RabbitMessageOperations extends MessageSendingOperations<String>, MessageReceivingOperations<String>, MessageRequestReplyOperations<String>
MessageSendingOperations and MessageRequestReplyOperations
for AMQP related operations that allow to specify not only the exchange but also the
routing key to use.RabbitTemplate| Modifier and Type | Method and Description |
|---|---|
void |
convertAndSend(String exchange,
String routingKey,
Object payload)
Convert the given Object to serialized form, possibly using a
MessageConverter,
wrap it as a message and send it to a specific exchange with a
specific routing key. |
void |
convertAndSend(String exchange,
String routingKey,
Object payload,
Map<String,Object> headers)
Convert the given Object to serialized form, possibly using a
MessageConverter,
wrap it as a message with the given headers and send it to a
specific exchange with a specific routing key. |
void |
convertAndSend(String exchange,
String routingKey,
Object payload,
Map<String,Object> headers,
MessagePostProcessor postProcessor)
Convert the given 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 a specific exchange with a specific
routing key. |
void |
convertAndSend(String exchange,
String routingKey,
Object payload,
MessagePostProcessor postProcessor)
Convert the given Object to serialized form, possibly using a
MessageConverter,
wrap it as a message, apply the given post processor, and send
the resulting message to a specific exchange with a specific
routing key. |
<T> T |
convertSendAndReceive(String exchange,
String routingKey,
Object request,
Class<T> targetClass)
Convert the given request Object to serialized form, possibly using a
MessageConverter, send
it as a Message to a specific exchange with a specific routing key,
receive the reply and convert its body of the specified target class. |
<T> T |
convertSendAndReceive(String exchange,
String routingKey,
Object request,
Class<T> targetClass,
MessagePostProcessor requestPostProcessor)
Convert the given request Object to serialized form, possibly using a
MessageConverter,
apply the given post processor and send the resulting Message to
a specific exchange with a specific routing key, receive the reply and
convert its body of the given target class. |
<T> T |
convertSendAndReceive(String exchange,
String routingKey,
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 a specific exchange
with a specific routing key, receive the reply and convert its body of
the specified target class. |
<T> T |
convertSendAndReceive(String exchange,
String routingKey,
Object request,
Map<String,Object> headers,
Class<T> targetClass,
MessagePostProcessor requestPostProcessor)
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 a specific exchange with a
specific routing key,, receive the reply and convert its body of the
given target class. |
void |
send(String exchange,
String routingKey,
Message<?> message)
Send a message to a specific exchange with a specific routing key.
|
Message<?> |
sendAndReceive(String exchange,
String routingKey,
Message<?> requestMessage)
Send a request message to a specific exchange with a specific routing key and
wait for the reply.
|
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, send, sendreceive, receive, receiveAndConvert, receiveAndConvertconvertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceive, sendAndReceivevoid send(String exchange, String routingKey, Message<?> message) throws MessagingException
exchange - the name of the exchangeroutingKey - the routing keymessage - the message to sendMessagingException - a messaging exception.void convertAndSend(String exchange, String routingKey, Object payload) throws MessagingException
MessageConverter,
wrap it as a message and send it to a specific exchange with a
specific routing key.exchange - the name of the exchangeroutingKey - the routing keypayload - the Object to use as payloadMessagingException - a messaging exception.void convertAndSend(String exchange, String routingKey, Object payload, Map<String,Object> headers) throws MessagingException
MessageConverter,
wrap it as a message with the given headers and send it to a
specific exchange with a specific routing key.exchange - the name of the exchangeroutingKey - the routing keypayload - the Object to use as payloadheaders - headers for the message to sendMessagingException - a messaging exception.void convertAndSend(String exchange, String routingKey, Object payload, MessagePostProcessor postProcessor) throws MessagingException
MessageConverter,
wrap it as a message, apply the given post processor, and send
the resulting message to a specific exchange with a specific
routing key.exchange - the name of the exchangeroutingKey - the routing keypayload - the Object to use as payloadpostProcessor - the post processor to apply to the messageMessagingException - a messaging exception.void convertAndSend(String exchange, String routingKey, Object payload, Map<String,Object> headers, MessagePostProcessor postProcessor) throws MessagingException
MessageConverter,
wrap it as a message with the given headers, apply the given post processor,
and send the resulting message to a specific exchange with a specific
routing key.exchange - the name of the exchangeroutingKey - the routing keypayload - the Object to use as payloadheaders - headers for the message to sendpostProcessor - the post processor to apply to the messageMessagingException - a messaging exception.Message<?> sendAndReceive(String exchange, String routingKey, Message<?> requestMessage) throws MessagingException
exchange - the name of the exchangeroutingKey - the routing keyrequestMessage - the message to sendnull if the message could not be received,
for example due to a timeoutMessagingException - a messaging exception.<T> T convertSendAndReceive(String exchange, String routingKey, Object request, Class<T> targetClass) throws MessagingException
MessageConverter, send
it as a Message to a specific exchange with a specific routing key,
receive the reply and convert its body of the specified target class.T - return typeexchange - the name of the exchangeroutingKey - the routing keyrequest - 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 timeoutMessagingException - a messaging exception.<T> T convertSendAndReceive(String exchange, String routingKey, Object request, Map<String,Object> headers, Class<T> targetClass) throws MessagingException
MessageConverter, send
it as a Message with the given headers, to a specific exchange
with a specific routing key, receive the reply and convert its body of
the specified target class.T - return typeexchange - the name of the exchangeroutingKey - the routing keyrequest - 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 timeoutMessagingException - a messaging exception.<T> T convertSendAndReceive(String exchange, String routingKey, Object request, Class<T> targetClass, MessagePostProcessor requestPostProcessor) throws MessagingException
MessageConverter,
apply the given post processor and send the resulting Message to
a specific exchange with a specific routing key, receive the reply and
convert its body of the given target class.T - return typeexchange - the name of the exchangeroutingKey - the routing keyrequest - 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 messagenull if the message
could not be received, for example due to a timeoutMessagingException - a messaging exception.<T> T convertSendAndReceive(String exchange, String routingKey, Object request, Map<String,Object> headers, Class<T> targetClass, MessagePostProcessor requestPostProcessor) throws MessagingException
MessageConverter,
wrap it as a message with the given headers, apply the given post processor
and send the resulting Message to a specific exchange with a
specific routing key,, receive the reply and convert its body of the
given target class.T - return typeexchange - the name of the exchangeroutingKey - the routing keyrequest - payload for the request message to sendheaders - headers for the message to sendtargetClass - the target type to convert the payload of the reply torequestPostProcessor - post process to apply to the request messagenull if the message
could not be received, for example due to a timeoutMessagingException - a messaging exception.