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
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
RabbitFuture
(String correlationId, Message requestMessage, BiConsumer<String, @Nullable DirectReplyToMessageListenerContainer.ChannelHolder> canceler, Function<RabbitFuture<?>, @Nullable ScheduledFuture<?>> timeoutTaskFunction) -
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel
(boolean mayInterruptIfRunning) boolean
boolean
When confirms are enabled contains aCompletableFuture
for the confirmation.@Nullable String
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, exceptionNow, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, resultNow, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, state, 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, @Nullable DirectReplyToMessageListenerContainer.ChannelHolder> canceler, Function<RabbitFuture<?>, @Nullable ScheduledFuture<?>> timeoutTaskFunction)
-
-
Method Details
-
complete
- Overrides:
complete
in classCompletableFuture<T>
-
completeExceptionally
- Overrides:
completeExceptionally
in classCompletableFuture<T>
-
cancel
-
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.
-