Interface AmqpClient.ReceiveSpec
- Enclosing interface:
AmqpClient
public static interface AmqpClient.ReceiveSpec
The fluent API for the receiving operation based on the
from address.- Since:
- 4.1
- Author:
- Artem Bilan
-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletableFuture<Message> receive()Receive a Spring AMQP message from the providedfromaddress.<T> CompletableFuture<T> receiveAndConvert(T... reified) Receive a message from the providedfromaddress and convert its body to the provided generic type.CompletableFuture<org.apache.qpid.protonj2.client.Message<?>> Receive a native ProtonJ message from the providedfromaddress.Set a timeout for the delivery.
-
Method Details
-
timeout
Set a timeout for the delivery. The maximum is limited by theAmqpClient.Builder.completionTimeout(Duration)which is 1 minute by default.- Parameters:
timeout- to wait for the delivery.- Returns:
- a
CompletableFuturewith the message.
-
receive
Receive a Spring AMQP message from the providedfromaddress.- Returns:
- a
CompletableFuturewith the message.
-
receiveProtonMessage
CompletableFuture<org.apache.qpid.protonj2.client.Message<?>> receiveProtonMessage()Receive a native ProtonJ message from the providedfromaddress.- Returns:
- a
CompletableFuturewith the message.
-
receiveAndConvert
Receive a message from the providedfromaddress and convert its body to the provided generic type.- Type Parameters:
T- the type to convert the message body into.- Parameters:
reified- the argument which is used to extract a generic type for conversion. Must not be set!- Returns:
- a
CompletableFuturewith payload of the expected type converted from the message body.
-