Package io.servicetalk.http.netty
Class RetryingHttpRequesterFilter.BackOffPolicy
java.lang.Object
io.servicetalk.http.netty.RetryingHttpRequesterFilter.BackOffPolicy
- Enclosing class:
- RetryingHttpRequesterFilter
Definition and presets of retry backoff policies.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final RetryingHttpRequesterFilter.BackOffPolicy
Deprecated.This will be removed in a future release of ST. -
Method Summary
Modifier and TypeMethodDescriptionnewStrategy
(Executor alternativeTimerExecutor) Builds a new retry strategyBiIntFunction
for retrying withPublisher.retryWhen(BiIntFunction)
,Single.retryWhen(BiIntFunction)
, andCompletable.retryWhen(BiIntFunction)
or in general with an alternative timerExecutor
.ofConstantBackoffDeltaJitter
(Duration delay, Duration jitter, int maxRetries) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a randomized delay between retries and uses the passedDuration
as a maximum delay possible.ofConstantBackoffDeltaJitter
(Duration delay, Duration jitter, Executor timerExecutor, int maxRetries) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a randomized delay between retries and uses the passedDuration
as a maximum delay possible.ofConstantBackoffFullJitter
(Duration delay, int maxRetries) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a randomized delay between retries and uses the passedDuration
as a maximum delay possible.ofConstantBackoffFullJitter
(Duration delay, int maxRetries, Executor timerExecutor) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a randomized delay between retries and uses the passedDuration
as a maximum delay possible.ofExponentialBackoffDeltaJitter
(Duration initialDelay, Duration jitter, Duration maxDelay, int maxRetries) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a delay between retries.ofExponentialBackoffDeltaJitter
(Duration initialDelay, Duration jitter, Duration maxDelay, int maxRetries, Executor timerExecutor) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a delay between retries.ofExponentialBackoffFullJitter
(Duration initialDelay, Duration maxDelay, int maxRetries) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a delay between retries.ofExponentialBackoffFullJitter
(Duration initialDelay, Duration maxDelay, int maxRetries, Executor timerExecutor) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a delay between retries.Deprecated.UseofImmediateBounded()
.ofImmediate
(int maxRetries) Creates a newRetryingHttpRequesterFilter.BackOffPolicy
that retries failures instantly up-to provided max retries.Creates a newRetryingHttpRequesterFilter.BackOffPolicy
that retries failures instantly up-to 3 max retries.SpecialRetryingHttpRequesterFilter.BackOffPolicy
that signals that no retries will be attempted.toString()
-
Field Details
-
NO_RETRIES
Deprecated.This will be removed in a future release of ST. Alternative offering hereofNoRetries()
.SpecialRetryingHttpRequesterFilter.BackOffPolicy
to signal no retries.
-
-
Method Details
-
toString
-
ofImmediate
Deprecated.UseofImmediateBounded()
.Creates a newRetryingHttpRequesterFilter.BackOffPolicy
that retries failures instantly up-to 3 max retries.- Returns:
- a new
RetryingHttpRequesterFilter.BackOffPolicy
that retries failures instantly up-to 3 max retries.
-
ofImmediateBounded
Creates a newRetryingHttpRequesterFilter.BackOffPolicy
that retries failures instantly up-to 3 max retries.- Returns:
- a new
RetryingHttpRequesterFilter.BackOffPolicy
that retries failures instantly up-to 3 max retries. - See Also:
-
ofImmediate
Creates a newRetryingHttpRequesterFilter.BackOffPolicy
that retries failures instantly up-to provided max retries.- Parameters:
maxRetries
- the number of retry attempts for thisRetryingHttpRequesterFilter.BackOffPolicy
.- Returns:
- a new
RetryingHttpRequesterFilter.BackOffPolicy
that retries failures instantly up-to provided max retries.
-
ofNoRetries
SpecialRetryingHttpRequesterFilter.BackOffPolicy
that signals that no retries will be attempted.- Returns:
- a special
RetryingHttpRequesterFilter.BackOffPolicy
that signals that no retries will be attempted.
-
ofConstantBackoffFullJitter
public static RetryingHttpRequesterFilter.BackOffPolicy ofConstantBackoffFullJitter(Duration delay, int maxRetries) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a randomized delay between retries and uses the passedDuration
as a maximum delay possible. This additionally adds a "Full Jitter" for the backoff as described here.- Parameters:
delay
- MaximumDuration
of delay between retriesmaxRetries
- The maximum retries before it gives up.- Returns:
- A new retrying
RetryingHttpRequesterFilter.BackOffPolicy
which adds a randomized delay between retries
-
ofConstantBackoffFullJitter
public static RetryingHttpRequesterFilter.BackOffPolicy ofConstantBackoffFullJitter(Duration delay, int maxRetries, Executor timerExecutor) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a randomized delay between retries and uses the passedDuration
as a maximum delay possible. This additionally adds a "Full Jitter" for the backoff as described here.- Parameters:
delay
- MaximumDuration
of delay between retriesmaxRetries
- The maximum retries before it gives up.timerExecutor
-Executor
to be used to schedule timers for backoff. It takes precedence over an alternative timerExecutor
fromnewStrategy(Executor)
argument- Returns:
- A new retrying
RetryingHttpRequesterFilter.BackOffPolicy
which adds a randomized delay between retries
-
ofConstantBackoffDeltaJitter
public static RetryingHttpRequesterFilter.BackOffPolicy ofConstantBackoffDeltaJitter(Duration delay, Duration jitter, int maxRetries) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a randomized delay between retries and uses the passedDuration
as a maximum delay possible.- Parameters:
delay
- MaximumDuration
of delay between retriesjitter
- The jitter which is used as and offset toinitialDelay
on each retrymaxRetries
- The maximum retries before it gives up.- Returns:
- A new retrying
RetryingHttpRequesterFilter.BackOffPolicy
which adds a randomized delay between retries
-
ofConstantBackoffDeltaJitter
public static RetryingHttpRequesterFilter.BackOffPolicy ofConstantBackoffDeltaJitter(Duration delay, Duration jitter, Executor timerExecutor, int maxRetries) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a randomized delay between retries and uses the passedDuration
as a maximum delay possible.- Parameters:
delay
- MaximumDuration
of delay between retriesjitter
- The jitter which is used as and offset todelay
on each retrytimerExecutor
-Executor
to be used to schedule timers for backoff.maxRetries
- The maximum retries before it gives up. It takes precedence over an alternative timerExecutor
fromnewStrategy(Executor)
argument- Returns:
- A new retrying
RetryingHttpRequesterFilter.BackOffPolicy
which adds a randomized delay between retries
-
ofExponentialBackoffFullJitter
public static RetryingHttpRequesterFilter.BackOffPolicy ofExponentialBackoffFullJitter(Duration initialDelay, Duration maxDelay, int maxRetries) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a delay between retries. For first retry, the delay isinitialDelay
which is increased exponentially for subsequent retries. This additionally adds a "Full Jitter" for the backoff as described here.- Parameters:
initialDelay
- DelayDuration
for the first retry and increased exponentially with each retrymaxDelay
- The maximum amount of delay that will be introduced.maxRetries
- The maximum retries before it gives up.- Returns:
- A new retrying
RetryingHttpRequesterFilter.BackOffPolicy
which adds an exponentially increasing delay between retries with jitter
-
ofExponentialBackoffFullJitter
public static RetryingHttpRequesterFilter.BackOffPolicy ofExponentialBackoffFullJitter(Duration initialDelay, Duration maxDelay, int maxRetries, Executor timerExecutor) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a delay between retries. For first retry, the delay isinitialDelay
which is increased exponentially for subsequent retries. This additionally adds a "Full Jitter" for the backoff as described here.- Parameters:
initialDelay
- DelayDuration
for the first retry and increased exponentially with each retrymaxDelay
- The maximum amount of delay that will be introduced.maxRetries
- The maximum retries before it gives up.timerExecutor
-Executor
to be used to schedule timers for backoff. It takes precedence over an alternative timerExecutor
fromnewStrategy(Executor)
argument- Returns:
- A new retrying
RetryingHttpRequesterFilter.BackOffPolicy
which adds an exponentially increasing delay between retries with jitter
-
ofExponentialBackoffDeltaJitter
public static RetryingHttpRequesterFilter.BackOffPolicy ofExponentialBackoffDeltaJitter(Duration initialDelay, Duration jitter, Duration maxDelay, int maxRetries) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a delay between retries. For first retry, the delay isinitialDelay
which is increased exponentially for subsequent retries.- Parameters:
initialDelay
- DelayDuration
for the first retry and increased exponentially with each retryjitter
- The jitter which is used as and offset toinitialDelay
on each retrymaxDelay
- The maximum amount of delay that will be introduced.maxRetries
- The maximum retries before it gives up.- Returns:
- A new retrying
RetryingHttpRequesterFilter.BackOffPolicy
which adds an exponentially increasing delay between retries with jitter
-
ofExponentialBackoffDeltaJitter
public static RetryingHttpRequesterFilter.BackOffPolicy ofExponentialBackoffDeltaJitter(Duration initialDelay, Duration jitter, Duration maxDelay, int maxRetries, Executor timerExecutor) Creates a new retryingRetryingHttpRequesterFilter.BackOffPolicy
which adds a delay between retries. For first retry, the delay isinitialDelay
which is increased exponentially for subsequent retries.- Parameters:
initialDelay
- DelayDuration
for the first retry and increased exponentially with each retryjitter
- The jitter which is used as and offset toinitialDelay
on each retrymaxDelay
- The maximum amount of delay that will be introduced.maxRetries
- The maximum retries before it gives up.timerExecutor
-Executor
to be used to schedule timers for backoff. It takes precedence over an alternative timerExecutor
fromnewStrategy(Executor)
argument- Returns:
- A new retrying
RetryingHttpRequesterFilter.BackOffPolicy
which adds an exponentially increasing delay between retries with jitter
-
newStrategy
Builds a new retry strategyBiIntFunction
for retrying withPublisher.retryWhen(BiIntFunction)
,Single.retryWhen(BiIntFunction)
, andCompletable.retryWhen(BiIntFunction)
or in general with an alternative timerExecutor
.- Parameters:
alternativeTimerExecutor
-Executor
to be used to schedule timers for backoff if no executor was provided at the build time- Returns:
- a new retry strategy
BiIntFunction
-