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
CompletableFutures 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
ConstructorsModifierConstructorDescriptionprotectedRabbitFuture(String correlationId, Message requestMessage, BiConsumer<String, DirectReplyToMessageListenerContainer.ChannelHolder> canceler, Function<RabbitFuture<?>, ScheduledFuture<?>> timeoutTaskFunction) -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel(boolean mayInterruptIfRunning) booleanbooleanWhen confirms are enabled contains aCompletableFuturefor 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:
completein classCompletableFuture<T>
-
completeExceptionally
- Overrides:
completeExceptionallyin classCompletableFuture<T>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
getConfirm
When confirms are enabled contains aCompletableFuturefor 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.
-