程序包 | 说明 |
---|---|
reactor.util.retry |
限定符和类型 | 方法和说明 |
---|---|
static RetryBackoffSpec |
Retry.backoff(long maxAttempts,
java.time.Duration minBackoff)
A
RetryBackoffSpec preconfigured for exponential backoff strategy with jitter, given a maximum number of retry attempts
and a minimum Duration for the backoff. |
RetryBackoffSpec |
RetryBackoffSpec.doAfterRetry(java.util.function.Consumer<Retry.RetrySignal> doAfterRetry)
Add synchronous behavior to be executed after the retry trigger is emitted in
the companion publisher.
|
RetryBackoffSpec |
RetryBackoffSpec.doAfterRetryAsync(java.util.function.Function<Retry.RetrySignal,Mono<java.lang.Void>> doAsyncAfterRetry)
Add asynchronous behavior to be executed after the current retry trigger in the companion publisher,
thus delaying the resulting retry trigger with the additional
Mono . |
RetryBackoffSpec |
RetryBackoffSpec.doBeforeRetry(java.util.function.Consumer<Retry.RetrySignal> doBeforeRetry)
Add synchronous behavior to be executed before the retry trigger is emitted in
the companion publisher.
|
RetryBackoffSpec |
RetryBackoffSpec.doBeforeRetryAsync(java.util.function.Function<Retry.RetrySignal,Mono<java.lang.Void>> doAsyncBeforeRetry)
Add asynchronous behavior to be executed before the current retry trigger in the companion publisher,
thus delaying the resulting retry trigger with the additional
Mono . |
RetryBackoffSpec |
RetryBackoffSpec.filter(java.util.function.Predicate<? super java.lang.Throwable> errorFilter)
Set the
Predicate that will filter which errors can be retried. |
static RetryBackoffSpec |
Retry.fixedDelay(long maxAttempts,
java.time.Duration fixedDelay)
A
RetryBackoffSpec preconfigured for fixed delays (min backoff equals max backoff, no jitter), given a maximum number of retry attempts
and the fixed Duration for the backoff. |
RetryBackoffSpec |
RetryBackoffSpec.jitter(double jitterFactor)
Set a jitter factor for exponential backoffs that adds randomness to each backoff.
|
RetryBackoffSpec |
RetryBackoffSpec.maxAttempts(long maxAttempts)
Set the maximum number of retry attempts allowed. 1 meaning "1 retry attempt":
the original subscription plus an extra re-subscription in case of an error, but
no more.
|
RetryBackoffSpec |
RetryBackoffSpec.maxBackoff(java.time.Duration maxBackoff)
Set a hard maximum
Duration for exponential backoffs. |
RetryBackoffSpec |
RetryBackoffSpec.minBackoff(java.time.Duration minBackoff)
Set the minimum
Duration for the first backoff. |
RetryBackoffSpec |
RetryBackoffSpec.modifyErrorFilter(java.util.function.Function<java.util.function.Predicate<java.lang.Throwable>,java.util.function.Predicate<? super java.lang.Throwable>> predicateAdjuster)
Allows to augment a previously
set Predicate with
a new condition to allow retries of some exception or not. |
RetryBackoffSpec |
RetryBackoffSpec.onRetryExhaustedThrow(java.util.function.BiFunction<RetryBackoffSpec,Retry.RetrySignal,java.lang.Throwable> retryExhaustedGenerator)
Set the generator for the
Exception to be propagated when the maximum amount of retries
is exhausted. |
RetryBackoffSpec |
RetryBackoffSpec.scheduler(Scheduler backoffScheduler)
Set a
Scheduler on which to execute the delays computed by the exponential backoff
strategy. |
RetryBackoffSpec |
RetryBackoffSpec.transientErrors(boolean isTransientErrors)
Set the transient error mode, indicating that the strategy being built should use
Retry.RetrySignal.totalRetriesInARow() rather than
Retry.RetrySignal.totalRetries() . |
RetryBackoffSpec |
RetryBackoffSpec.withRetryContext(ContextView retryContext)
Set the user provided
context that can be used to manipulate state on retries. |
限定符和类型 | 方法和说明 |
---|---|
RetryBackoffSpec |
RetryBackoffSpec.onRetryExhaustedThrow(java.util.function.BiFunction<RetryBackoffSpec,Retry.RetrySignal,java.lang.Throwable> retryExhaustedGenerator)
Set the generator for the
Exception to be propagated when the maximum amount of retries
is exhausted. |