Package org.springframework.amqp.rabbit
Class RabbitFuture<T>
java.lang.Object
java.util.concurrent.CompletableFuture<T>
org.springframework.amqp.rabbit.RabbitFuture<T>
- Type Parameters:
T
- the type.
- All Implemented Interfaces:
CompletionStage<T>
,Future<T>
- Direct Known Subclasses:
RabbitConverterFuture
,RabbitMessageFuture
Base class for
CompletableFuture
s returned by AsyncRabbitTemplate
.- Since:
- 2.4.7
- Author:
- Gary Russell, Artem Bilan
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
-
Constructor Summary
ModifierConstructorDescriptionprotected
RabbitFuture
(String correlationId, Message requestMessage, BiConsumer<String, DirectReplyToMessageListenerContainer.ChannelHolder> canceler, Function<RabbitFuture<?>, ScheduledFuture<?>> timeoutTaskFunction) -
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel
(boolean mayInterruptIfRunning) boolean
boolean
When confirms are enabled contains aCompletableFuture
for the confirmation.When confirms are enabled and a nack is received, contains the cause for the nack, if any.Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, completeAsync, completeAsync, completedFuture, completedStage, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
-
Constructor Details
-
RabbitFuture
protected RabbitFuture(String correlationId, Message requestMessage, BiConsumer<String, DirectReplyToMessageListenerContainer.ChannelHolder> canceler, Function<RabbitFuture<?>, ScheduledFuture<?>> timeoutTaskFunction)
-
-
Method Details
-
complete
- Overrides:
complete
in classCompletableFuture<T>
-
completeExceptionally
- Overrides:
completeExceptionally
in classCompletableFuture<T>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
getConfirm
When confirms are enabled contains aCompletableFuture
for the confirmation.- Returns:
- the future.
-
getNackCause
When confirms are enabled and a nack is received, contains the cause for the nack, if any.- Returns:
- the cause.
-