Interface AsyncAmqpTemplate
- All Known Implementing Classes:
AsyncRabbitTemplate
,RabbitAmqpTemplate
public interface AsyncAmqpTemplate
Classes implementing this interface can perform asynchronous send and
receive operations using
CompletableFuture
s.- Since:
- 2.0
- Author:
- Gary Russell, Artem Bilan
-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletableFuture
<Boolean> convertAndSend
(Object message) default CompletableFuture
<Boolean> convertAndSend
(Object message, @Nullable MessagePostProcessor messagePostProcessor) default CompletableFuture
<Boolean> convertAndSend
(String exchange, @Nullable String routingKey, Object message) default CompletableFuture
<Boolean> convertAndSend
(String exchange, @Nullable String routingKey, Object message, @Nullable MessagePostProcessor messagePostProcessor) default CompletableFuture
<Boolean> convertAndSend
(String queue, Object message) default CompletableFuture
<Boolean> convertAndSend
(String queue, Object message, @Nullable MessagePostProcessor messagePostProcessor) <C> CompletableFuture
<C> convertSendAndReceive
(Object object) Convert the object to a message and send it to the default exchange with the default routing key.<C> CompletableFuture
<C> convertSendAndReceive
(Object object, MessagePostProcessor messagePostProcessor) Convert the object to a message and send it to the default exchange with the default routing key after invoking theMessagePostProcessor
.<C> CompletableFuture
<C> convertSendAndReceive
(String routingKey, Object object) Convert the object to a message and send it to the default exchange with the provided routing key.<C> CompletableFuture
<C> convertSendAndReceive
(String routingKey, Object object, MessagePostProcessor messagePostProcessor) Convert the object to a message and send it to the default exchange with the provided routing key after invoking theMessagePostProcessor
.<C> CompletableFuture
<C> convertSendAndReceive
(String exchange, String routingKey, Object object) Convert the object to a message and send it to the provided exchange and routing key.<C> CompletableFuture
<C> convertSendAndReceive
(String exchange, String routingKey, Object object, @Nullable MessagePostProcessor messagePostProcessor) Convert the object to a message and send it to the provided exchange and routing key after invoking theMessagePostProcessor
.<C> CompletableFuture
<C> convertSendAndReceiveAsType
(Object object, MessagePostProcessor messagePostProcessor, ParameterizedTypeReference<C> responseType) Convert the object to a message and send it to the default exchange with the default routing key after invoking theMessagePostProcessor
.<C> CompletableFuture
<C> convertSendAndReceiveAsType
(Object object, ParameterizedTypeReference<C> responseType) Convert the object to a message and send it to the default exchange with the default routing key.<C> CompletableFuture
<C> convertSendAndReceiveAsType
(String routingKey, Object object, @Nullable MessagePostProcessor messagePostProcessor, @Nullable ParameterizedTypeReference<C> responseType) Convert the object to a message and send it to the default exchange with the provided routing key after invoking theMessagePostProcessor
.<C> CompletableFuture
<C> convertSendAndReceiveAsType
(String routingKey, Object object, ParameterizedTypeReference<C> responseType) Convert the object to a message and send it to the default exchange with the provided routing key.<C> CompletableFuture
<C> convertSendAndReceiveAsType
(String exchange, String routingKey, Object object, @Nullable MessagePostProcessor messagePostProcessor, @Nullable ParameterizedTypeReference<C> responseType) Convert the object to a message and send it to the provided exchange and routing key after invoking theMessagePostProcessor
.<C> CompletableFuture
<C> convertSendAndReceiveAsType
(String exchange, String routingKey, Object object, ParameterizedTypeReference<C> responseType) Convert the object to a message and send it to the provided exchange and routing key.default CompletableFuture
<Message> receive()
default CompletableFuture
<Message> default CompletableFuture
<Object> default CompletableFuture
<Object> receiveAndConvert
(String queueName) default <T> CompletableFuture
<T> receiveAndConvert
(String queueName, ParameterizedTypeReference<T> type) default <T> CompletableFuture
<T> default CompletableFuture
<Boolean> default CompletableFuture
<Boolean> default CompletableFuture
<Boolean> sendAndReceive
(String exchange, String routingKey, Message message) Send a message to the supplied exchange and routing key.sendAndReceive
(String routingKey, Message message) Send a message to the default exchange with the supplied routing key.sendAndReceive
(Message message) Send a message to the default exchange with the default routing key.
-
Method Details
-
send
-
send
-
send
default CompletableFuture<Boolean> send(String exchange, @Nullable String routingKey, Message message) -
convertAndSend
-
convertAndSend
-
convertAndSend
default CompletableFuture<Boolean> convertAndSend(String exchange, @Nullable String routingKey, Object message) -
convertAndSend
default CompletableFuture<Boolean> convertAndSend(Object message, @Nullable MessagePostProcessor messagePostProcessor) -
convertAndSend
default CompletableFuture<Boolean> convertAndSend(String queue, Object message, @Nullable MessagePostProcessor messagePostProcessor) -
convertAndSend
default CompletableFuture<Boolean> convertAndSend(String exchange, @Nullable String routingKey, Object message, @Nullable MessagePostProcessor messagePostProcessor) -
receive
-
receive
-
receiveAndConvert
-
receiveAndConvert
-
receiveAndConvert
-
receiveAndConvert
default <T> CompletableFuture<T> receiveAndConvert(String queueName, ParameterizedTypeReference<T> type) -
sendAndReceive
Send a message to the default exchange with the default routing key. If the message contains a correlationId property, it must be unique.- Parameters:
message
- the message.- Returns:
- the
CompletableFuture
.
-
sendAndReceive
Send a message to the default exchange with the supplied routing key. If the message contains a correlationId property, it must be unique.- Parameters:
routingKey
- the routing key.message
- the message.- Returns:
- the
CompletableFuture
.
-
sendAndReceive
Send a message to the supplied exchange and routing key. If the message contains a correlationId property, it must be unique.- Parameters:
exchange
- the exchange.routingKey
- the routing key.message
- the message.- Returns:
- the
CompletableFuture
.
-
convertSendAndReceive
Convert the object to a message and send it to the default exchange with the default routing key.- Type Parameters:
C
- the expected result type.- Parameters:
object
- the object to convert.- Returns:
- the
CompletableFuture
.
-
convertSendAndReceive
Convert the object to a message and send it to the default exchange with the provided routing key.- Type Parameters:
C
- the expected result type.- Parameters:
routingKey
- the routing key.object
- the object to convert.- Returns:
- the
CompletableFuture
.
-
convertSendAndReceive
Convert the object to a message and send it to the provided exchange and routing key.- Type Parameters:
C
- the expected result type.- Parameters:
exchange
- the exchange.routingKey
- the routing key.object
- the object to convert.- Returns:
- the
CompletableFuture
.
-
convertSendAndReceive
<C> CompletableFuture<C> convertSendAndReceive(Object object, MessagePostProcessor messagePostProcessor) Convert the object to a message and send it to the default exchange with the default routing key after invoking theMessagePostProcessor
. If the post processor adds a correlationId property, it must be unique.- Type Parameters:
C
- the expected result type.- Parameters:
object
- the object to convert.messagePostProcessor
- the post processor.- Returns:
- the
CompletableFuture
.
-
convertSendAndReceive
<C> CompletableFuture<C> convertSendAndReceive(String routingKey, Object object, MessagePostProcessor messagePostProcessor) Convert the object to a message and send it to the default exchange with the provided routing key after invoking theMessagePostProcessor
. If the post processor adds a correlationId property, it must be unique.- Type Parameters:
C
- the expected result type.- Parameters:
routingKey
- the routing key.object
- the object to convert.messagePostProcessor
- the post processor.- Returns:
- the
CompletableFuture
.
-
convertSendAndReceive
<C> CompletableFuture<C> convertSendAndReceive(String exchange, String routingKey, Object object, @Nullable MessagePostProcessor messagePostProcessor) Convert the object to a message and send it to the provided exchange and routing key after invoking theMessagePostProcessor
. If the post processor adds a correlationId property, it must be unique.- Type Parameters:
C
- the expected result type.- Parameters:
exchange
- the exchangeroutingKey
- the routing key.object
- the object to convert.messagePostProcessor
- the post processor.- Returns:
- the
CompletableFuture
.
-
convertSendAndReceiveAsType
<C> CompletableFuture<C> convertSendAndReceiveAsType(Object object, ParameterizedTypeReference<C> responseType) Convert the object to a message and send it to the default exchange with the default routing key.- Type Parameters:
C
- the expected result type.- Parameters:
object
- the object to convert.responseType
- the response type.- Returns:
- the
CompletableFuture
.
-
convertSendAndReceiveAsType
<C> CompletableFuture<C> convertSendAndReceiveAsType(String routingKey, Object object, ParameterizedTypeReference<C> responseType) Convert the object to a message and send it to the default exchange with the provided routing key.- Type Parameters:
C
- the expected result type.- Parameters:
routingKey
- the routing key.object
- the object to convert.responseType
- the response type.- Returns:
- the
CompletableFuture
.
-
convertSendAndReceiveAsType
<C> CompletableFuture<C> convertSendAndReceiveAsType(String exchange, String routingKey, Object object, ParameterizedTypeReference<C> responseType) Convert the object to a message and send it to the provided exchange and routing key.- Type Parameters:
C
- the expected result type.- Parameters:
exchange
- the exchange.routingKey
- the routing key.object
- the object to convert.responseType
- the response type.- Returns:
- the
CompletableFuture
.
-
convertSendAndReceiveAsType
<C> CompletableFuture<C> convertSendAndReceiveAsType(Object object, MessagePostProcessor messagePostProcessor, ParameterizedTypeReference<C> responseType) Convert the object to a message and send it to the default exchange with the default routing key after invoking theMessagePostProcessor
. If the post processor adds a correlationId property, it must be unique.- Type Parameters:
C
- the expected result type.- Parameters:
object
- the object to convert.messagePostProcessor
- the post processor.responseType
- the response type.- Returns:
- the
CompletableFuture
.
-
convertSendAndReceiveAsType
<C> CompletableFuture<C> convertSendAndReceiveAsType(String routingKey, Object object, @Nullable MessagePostProcessor messagePostProcessor, @Nullable ParameterizedTypeReference<C> responseType) Convert the object to a message and send it to the default exchange with the provided routing key after invoking theMessagePostProcessor
. If the post processor adds a correlationId property, it must be unique.- Type Parameters:
C
- the expected result type.- Parameters:
routingKey
- the routing key.object
- the object to convert.messagePostProcessor
- the post processor.responseType
- the response type.- Returns:
- the
CompletableFuture
.
-
convertSendAndReceiveAsType
<C> CompletableFuture<C> convertSendAndReceiveAsType(String exchange, String routingKey, Object object, @Nullable MessagePostProcessor messagePostProcessor, @Nullable ParameterizedTypeReference<C> responseType) Convert the object to a message and send it to the provided exchange and routing key after invoking theMessagePostProcessor
. If the post processor adds a correlationId property, it must be unique.- Type Parameters:
C
- the expected result type.- Parameters:
exchange
- the exchangeroutingKey
- the routing key.object
- the object to convert.messagePostProcessor
- the post processor.responseType
- the response type.- Returns:
- the
CompletableFuture
.
-