Package org.springframework.amqp.core
Interface AmqpTemplate
- All Known Subinterfaces:
RabbitOperations
- All Known Implementing Classes:
BatchingRabbitTemplate,RabbitTemplate,TestRabbitTemplate
public interface AmqpTemplate
Specifies a basic set of AMQP operations.
Provides synchronous send and receive methods. The convertAndSend(Object) and
receiveAndConvert() methods allow let you send and receive POJO objects.
Implementations are expected to delegate to an instance of
MessageConverter to perform
conversion to and from AMQP byte[] payload type.
- Author:
- Mark Pollack, Mark Fisher, Artem Bilan, Ernest Sadykov, Gary Russell, Artem Bilan
-
Method Summary
Modifier and TypeMethodDescriptionvoidconvertAndSend(@Nullable String exchange, @Nullable String routingKey, Object message) Convert a Java object to an AmqpMessageand send it to a specific exchange with a specific routing key.voidconvertAndSend(@Nullable String exchange, @Nullable String routingKey, Object message, MessagePostProcessor messagePostProcessor) Convert a Java object to an AmqpMessageand send it to a specific exchange with a specific routing key.voidconvertAndSend(@Nullable String routingKey, Object message) Convert a Java object to an AmqpMessageand send it to a default exchange with a specific routing key.voidconvertAndSend(@Nullable String routingKey, Object message, MessagePostProcessor messagePostProcessor) Convert a Java object to an AmqpMessageand send it to a default exchange with a specific routing key.voidconvertAndSend(Object message) Convert a Java object to an AmqpMessageand send it to a default exchange with a default routing key.voidconvertAndSend(Object message, MessagePostProcessor messagePostProcessor) Convert a Java object to an AmqpMessageand send it to a default exchange with a default routing key.@Nullable ObjectconvertSendAndReceive(Object message) Basic RPC pattern with conversion.@Nullable ObjectconvertSendAndReceive(Object message, MessagePostProcessor messagePostProcessor) Basic RPC pattern with conversion.@Nullable ObjectconvertSendAndReceive(String routingKey, Object message) Basic RPC pattern with conversion.@Nullable ObjectconvertSendAndReceive(String routingKey, Object message, MessagePostProcessor messagePostProcessor) Basic RPC pattern with conversion.@Nullable ObjectconvertSendAndReceive(String exchange, String routingKey, Object message) Basic RPC pattern with conversion.@Nullable ObjectconvertSendAndReceive(String exchange, String routingKey, Object message, MessagePostProcessor messagePostProcessor) Basic RPC pattern with conversion.<T> @Nullable TconvertSendAndReceiveAsType(Object message, MessagePostProcessor messagePostProcessor, ParameterizedTypeReference<T> responseType) Basic RPC pattern with conversion.<T> @Nullable TconvertSendAndReceiveAsType(Object message, ParameterizedTypeReference<T> responseType) Basic RPC pattern with conversion.<T> @Nullable TconvertSendAndReceiveAsType(String routingKey, Object message, MessagePostProcessor messagePostProcessor, ParameterizedTypeReference<T> responseType) Basic RPC pattern with conversion.<T> @Nullable TconvertSendAndReceiveAsType(String routingKey, Object message, ParameterizedTypeReference<T> responseType) Basic RPC pattern with conversion.<T> @Nullable TconvertSendAndReceiveAsType(String exchange, String routingKey, Object message, MessagePostProcessor messagePostProcessor, ParameterizedTypeReference<T> responseType) Basic RPC pattern with conversion.<T> @Nullable TconvertSendAndReceiveAsType(String exchange, String routingKey, Object message, ParameterizedTypeReference<T> responseType) Basic RPC pattern with conversion.@Nullable Messagereceive()Receive a message if there is one from a default queue.@Nullable Messagereceive(long timeoutMillis) Receive a message from a default queue, waiting up to the specified wait time if necessary for a message to become available.@Nullable MessageReceive a message if there is one from a specific queue.@Nullable MessageReceive a message from a specific queue, waiting up to the specified wait time if necessary for a message to become available.@Nullable ObjectReceive a message if there is one from a default queue and convert it to a Java object.@Nullable ObjectreceiveAndConvert(long timeoutMillis) Receive a message if there is one from a default queue and convert it to a Java object.<T> @Nullable TreceiveAndConvert(long timeoutMillis, ParameterizedTypeReference<T> type) Receive a message if there is one from a default queue and convert it to a Java object.@Nullable ObjectreceiveAndConvert(String queueName) Receive a message if there is one from a specific queue and convert it to a Java object.@Nullable ObjectreceiveAndConvert(String queueName, long timeoutMillis) Receive a message if there is one from a specific queue and convert it to a Java object.<T> @Nullable TreceiveAndConvert(String queueName, long timeoutMillis, ParameterizedTypeReference<T> type) Receive a message if there is one from a specific queue and convert it to a Java object.<T> @Nullable TreceiveAndConvert(String queueName, ParameterizedTypeReference<T> type) Receive a message if there is one from a specific queue and convert it to a Java object.<T> @Nullable TReceive a message if there is one from a default queue and convert it to a Java object.<R,S> boolean receiveAndReply(String queueName, ReceiveAndReplyCallback<R, S> callback) Receive a message if there is one from provided queue, invoke providedReceiveAndReplyCallbackand send reply message, if thecallbackreturns one, to thereplyToAddressfromMessagePropertiesor to default exchange and default routingKey.<R,S> boolean receiveAndReply(String queueName, ReceiveAndReplyCallback<R, S> callback, String replyExchange, String replyRoutingKey) Receive a message if there is one from provided queue, invoke providedReceiveAndReplyCallbackand send reply message, if thecallbackreturns one, to the providedexchangeandroutingKey.<R,S> boolean receiveAndReply(String queueName, ReceiveAndReplyCallback<R, S> callback, ReplyToAddressCallback<S> replyToAddressCallback) Receive a message if there is one from provided queue, invoke providedReceiveAndReplyCallbackand send reply message, if thecallbackreturns one, to thereplyToAddressfrom result ofReplyToAddressCallback.<R,S> boolean receiveAndReply(ReceiveAndReplyCallback<R, S> callback) Receive a message if there is one from a default queue, invoke providedReceiveAndReplyCallbackand send reply message, if thecallbackreturns one, to thereplyToAddressfromMessagePropertiesor to default exchange and default routingKey.<R,S> boolean receiveAndReply(ReceiveAndReplyCallback<R, S> callback, String replyExchange, String replyRoutingKey) Receive a message if there is one from default queue, invoke providedReceiveAndReplyCallbackand send reply message, if thecallbackreturns one, to the providedexchangeandroutingKey.<R,S> boolean receiveAndReply(ReceiveAndReplyCallback<R, S> callback, ReplyToAddressCallback<S> replyToAddressCallback) Receive a message if there is one from a default queue, invoke providedReceiveAndReplyCallbackand send reply message, if thecallbackreturns one, to thereplyToAddressfrom result ofReplyToAddressCallback.voidSend a message to a specific exchange with a specific routing key.voidSend a message to a default exchange with a specific routing key.voidSend a message to a default exchange with a default routing key.@Nullable MessagesendAndReceive(String exchange, String routingKey, Message message)