public interface RabbitMessageOperations
extends org.springframework.messaging.core.MessageSendingOperations<java.lang.String>, org.springframework.messaging.core.MessageReceivingOperations<java.lang.String>, org.springframework.messaging.core.MessageRequestReplyOperations<java.lang.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(java.lang.String exchange,
java.lang.String routingKey,
java.lang.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(java.lang.String exchange,
java.lang.String routingKey,
java.lang.Object payload,
java.util.Map<java.lang.String,java.lang.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(java.lang.String exchange,
java.lang.String routingKey,
java.lang.Object payload,
java.util.Map<java.lang.String,java.lang.Object> headers,
org.springframework.messaging.core.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(java.lang.String exchange,
java.lang.String routingKey,
java.lang.Object payload,
org.springframework.messaging.core.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(java.lang.String exchange,
java.lang.String routingKey,
java.lang.Object request,
java.lang.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(java.lang.String exchange,
java.lang.String routingKey,
java.lang.Object request,
java.lang.Class<T> targetClass,
org.springframework.messaging.core.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(java.lang.String exchange,
java.lang.String routingKey,
java.lang.Object request,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.lang.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(java.lang.String exchange,
java.lang.String routingKey,
java.lang.Object request,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.lang.Class<T> targetClass,
org.springframework.messaging.core.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(java.lang.String exchange,
java.lang.String routingKey,
org.springframework.messaging.Message<?> message)
Send a message to a specific exchange with a specific routing key.
|
org.springframework.messaging.Message<?> |
sendAndReceive(java.lang.String exchange,
java.lang.String routingKey,
org.springframework.messaging.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, send
void send(java.lang.String exchange, java.lang.String routingKey, org.springframework.messaging.Message<?> message) throws org.springframework.messaging.MessagingException
exchange
- the name of the exchangeroutingKey
- the routing keymessage
- the message to sendorg.springframework.messaging.MessagingException
- a messaging exception.void convertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object payload) throws org.springframework.messaging.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 payloadorg.springframework.messaging.MessagingException
- a messaging exception.void convertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object payload, java.util.Map<java.lang.String,java.lang.Object> headers) throws org.springframework.messaging.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 sendorg.springframework.messaging.MessagingException
- a messaging exception.void convertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object payload, org.springframework.messaging.core.MessagePostProcessor postProcessor) throws org.springframework.messaging.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 messageorg.springframework.messaging.MessagingException
- a messaging exception.void convertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object payload, java.util.Map<java.lang.String,java.lang.Object> headers, org.springframework.messaging.core.MessagePostProcessor postProcessor) throws org.springframework.messaging.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 messageorg.springframework.messaging.MessagingException
- a messaging exception.org.springframework.messaging.Message<?> sendAndReceive(java.lang.String exchange, java.lang.String routingKey, org.springframework.messaging.Message<?> requestMessage) throws org.springframework.messaging.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 timeoutorg.springframework.messaging.MessagingException
- a messaging exception.<T> T convertSendAndReceive(java.lang.String exchange, java.lang.String routingKey, java.lang.Object request, java.lang.Class<T> targetClass) throws org.springframework.messaging.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 timeoutorg.springframework.messaging.MessagingException
- a messaging exception.<T> T convertSendAndReceive(java.lang.String exchange, java.lang.String routingKey, java.lang.Object request, java.util.Map<java.lang.String,java.lang.Object> headers, java.lang.Class<T> targetClass) throws org.springframework.messaging.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 timeoutorg.springframework.messaging.MessagingException
- a messaging exception.<T> T convertSendAndReceive(java.lang.String exchange, java.lang.String routingKey, java.lang.Object request, java.lang.Class<T> targetClass, org.springframework.messaging.core.MessagePostProcessor requestPostProcessor) throws org.springframework.messaging.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 timeoutorg.springframework.messaging.MessagingException
- a messaging exception.<T> T convertSendAndReceive(java.lang.String exchange, java.lang.String routingKey, java.lang.Object request, java.util.Map<java.lang.String,java.lang.Object> headers, java.lang.Class<T> targetClass, org.springframework.messaging.core.MessagePostProcessor requestPostProcessor) throws org.springframework.messaging.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 timeoutorg.springframework.messaging.MessagingException
- a messaging exception.