Interface RabbitMessageOperations
-
- All Superinterfaces:
MessageReceivingOperations<java.lang.String>,MessageRequestReplyOperations<java.lang.String>,MessageSendingOperations<java.lang.String>
- All Known Implementing Classes:
RabbitMessagingTemplate
public interface RabbitMessageOperations extends MessageSendingOperations<java.lang.String>, MessageReceivingOperations<java.lang.String>, MessageRequestReplyOperations<java.lang.String>
A specialization ofMessageSendingOperationsandMessageRequestReplyOperationsfor AMQP related operations that allow to specify not only the exchange but also the routing key to use.- Since:
- 1.4
- Author:
- Stephane Nicoll
- See Also:
RabbitTemplate
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconvertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object payload)Convert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message and send it to a specific exchange with a specific routing key.voidconvertAndSend(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 aMessageConverter, wrap it as a message with the given headers and send it to a specific exchange with a specific routing key.voidconvertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object payload, java.util.Map<java.lang.String,java.lang.Object> headers, MessagePostProcessor postProcessor)Convert the given Object to serialized form, possibly using aMessageConverter, 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.voidconvertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object payload, MessagePostProcessor postProcessor)Convert the given Object to serialized form, possibly using aMessageConverter, 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> TconvertSendAndReceive(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 aMessageConverter, send it as aMessageto a specific exchange with a specific routing key, receive the reply and convert its body of the specified target class.<T> TconvertSendAndReceive(java.lang.String exchange, java.lang.String routingKey, java.lang.Object request, java.lang.Class<T> targetClass, MessagePostProcessor requestPostProcessor)Convert the given request Object to serialized form, possibly using aMessageConverter, apply the given post processor and send the resultingMessageto a specific exchange with a specific routing key, receive the reply and convert its body of the given target class.<T> TconvertSendAndReceive(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 aMessageConverter, send it as aMessagewith 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> TconvertSendAndReceive(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, MessagePostProcessor requestPostProcessor)Convert the given request Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers, apply the given post processor and send the resultingMessageto a specific exchange with a specific routing key,, receive the reply and convert its body of the given target class.voidsend(java.lang.String exchange, java.lang.String routingKey, Message<?> message)Send a message to a specific exchange with a specific routing key.Message<?>sendAndReceive(java.lang.String exchange, java.lang.String routingKey, Message<?> requestMessage)Send a request message to a specific exchange with a specific routing key and wait for the reply.-
Methods inherited from interface org.springframework.messaging.core.MessageReceivingOperations
receive, receive, receiveAndConvert, receiveAndConvert
-
Methods inherited from interface org.springframework.messaging.core.MessageRequestReplyOperations
convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceive, sendAndReceive
-
Methods inherited from interface org.springframework.messaging.core.MessageSendingOperations
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, send, send
-
-
-
-
Method Detail
-
send
void send(java.lang.String exchange, java.lang.String routingKey, Message<?> message) throws MessagingExceptionSend a message to a specific exchange with a specific routing key.- Parameters:
exchange- the name of the exchangeroutingKey- the routing keymessage- the message to send- Throws:
MessagingException- a messaging exception.
-
convertAndSend
void convertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object payload) throws MessagingExceptionConvert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message and send it to a specific exchange with a specific routing key.- Parameters:
exchange- the name of the exchangeroutingKey- the routing keypayload- the Object to use as payload- Throws:
MessagingException- a messaging exception.
-
convertAndSend
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 MessagingExceptionConvert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers and send it to a specific exchange with a specific routing key.- Parameters:
exchange- the name of the exchangeroutingKey- the routing keypayload- the Object to use as payloadheaders- headers for the message to send- Throws:
MessagingException- a messaging exception.
-
convertAndSend
void convertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object payload, MessagePostProcessor postProcessor) throws MessagingExceptionConvert the given Object to serialized form, possibly using aMessageConverter, wrap it as a message, apply the given post processor, and send the resulting message to a specific exchange with a specific routing key.- Parameters:
exchange- the name of the exchangeroutingKey- the routing keypayload- the Object to use as payloadpostProcessor- the post processor to apply to the message- Throws:
MessagingException- a messaging exception.
-
convertAndSend
void convertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object payload, java.util.Map<java.lang.String,java.lang.Object> headers, MessagePostProcessor postProcessor) throws MessagingExceptionConvert the given Object to serialized form, possibly using aMessageConverter, 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.- Parameters:
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 message- Throws:
MessagingException- a messaging exception.
-
sendAndReceive
Message<?> sendAndReceive(java.lang.String exchange, java.lang.String routingKey, Message<?> requestMessage) throws MessagingException
Send a request message to a specific exchange with a specific routing key and wait for the reply.- Parameters:
exchange- the name of the exchangeroutingKey- the routing keyrequestMessage- the message to send- Returns:
- the reply, possibly
nullif the message could not be received, for example due to a timeout - Throws:
MessagingException- a messaging exception.
-
convertSendAndReceive
<T> T convertSendAndReceive(java.lang.String exchange, java.lang.String routingKey, java.lang.Object request, java.lang.Class<T> targetClass) throws MessagingExceptionConvert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessageto a specific exchange with a specific routing key, receive the reply and convert its body of the specified target class.- Type Parameters:
T- return type- Parameters:
exchange- 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 to- Returns:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout - Throws:
MessagingException- a messaging exception.
-
convertSendAndReceive
<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 MessagingExceptionConvert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessagewith the given headers, to a specific exchange with a specific routing key, receive the reply and convert its body of the specified target class.- Type Parameters:
T- return type- Parameters:
exchange- 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 to- Returns:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout - Throws:
MessagingException- a messaging exception.
-
convertSendAndReceive
<T> T convertSendAndReceive(java.lang.String exchange, java.lang.String routingKey, java.lang.Object request, java.lang.Class<T> targetClass, MessagePostProcessor requestPostProcessor) throws MessagingExceptionConvert the given request Object to serialized form, possibly using aMessageConverter, apply the given post processor and send the resultingMessageto a specific exchange with a specific routing key, receive the reply and convert its body of the given target class.- Type Parameters:
T- return type- Parameters:
exchange- 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 message- Returns:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout - Throws:
MessagingException- a messaging exception.
-
convertSendAndReceive
<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, MessagePostProcessor requestPostProcessor) throws MessagingExceptionConvert the given request Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers, apply the given post processor and send the resultingMessageto a specific exchange with a specific routing key,, receive the reply and convert its body of the given target class.- Type Parameters:
T- return type- Parameters:
exchange- 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 message- Returns:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout - Throws:
MessagingException- a messaging exception.
-
-