Class RetryingHttpRequesterFilter
- All Implemented Interfaces:
HttpExecutionStrategyInfluencer
,StreamingHttpClientFilterFactory
,ExecutionStrategyInfluencer<HttpExecutionStrategy>
Retries are supported for both the request flow and the response flow. Retries, in other words, can be triggered
as part of a service response if needed, through RetryingHttpRequesterFilter.Builder.responseMapper(Function)
.
Retries can have different criteria and different backoff polices, as defined from the relevant Builder methods (i.e.
RetryingHttpRequesterFilter.Builder.retryOther(BiFunction)
).
Similarly, max-retries for each flow can be set in the RetryingHttpRequesterFilter.BackOffPolicy
, as well
as a total max-retries to be respected by both flows, as set in
RetryingHttpRequesterFilter.Builder.maxTotalRetries(int)
.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Definition and presets of retry backoff policies.static final class
A builder forRetryingHttpRequesterFilter
, which puts an upper bound on retry attempts.static interface
Deprecated.static class
This exception indicates response that matched the retrying rules of theRetryingHttpRequesterFilter
and will-be/was retried.static interface
Callbacks invoked on a retry attempt. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(FilterableStreamingHttpClient client) Creates aStreamingHttpClientFilter
using the providedStreamingHttpClientFilter
.static RetryingHttpRequesterFilter
Retrying filter that disables any form of retry behaviour.static RetryingHttpRequesterFilter
Retrying filter that disables automatic retries for exceptions, but still waits untilLoadBalancer
becomesready
for the first time.Return anExecutionStrategy
that describes the offloads required by the influencer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.servicetalk.http.api.HttpExecutionStrategyInfluencer
influenceStrategy
-
Method Details
-
create
Description copied from interface:StreamingHttpClientFilterFactory
Creates aStreamingHttpClientFilter
using the providedStreamingHttpClientFilter
.- Specified by:
create
in interfaceStreamingHttpClientFilterFactory
- Parameters:
client
-FilterableStreamingHttpClient
to filter- Returns:
StreamingHttpClientFilter
using the providedStreamingHttpClientFilter
.
-
requiredOffloads
Description copied from interface:HttpExecutionStrategyInfluencer
Return anExecutionStrategy
that describes the offloads required by the influencer.The provided default implementation requests offloading of all operations. Implementations that require no offloading should be careful to return
HttpExecutionStrategies.offloadNone()
rather thanHttpExecutionStrategies.offloadNever()
. Implementations should avoid returningHttpExecutionStrategies.defaultStrategy()
, instead returning the strategy they require orHttpExecutionStrategies.offloadAll()
if offloading for all paths is required (safe default).- Specified by:
requiredOffloads
in interfaceExecutionStrategyInfluencer<HttpExecutionStrategy>
- Specified by:
requiredOffloads
in interfaceHttpExecutionStrategyInfluencer
- Returns:
- the
ExecutionStrategy
required by the influencer.
-
disableAutoRetries
Retrying filter that disables automatic retries for exceptions, but still waits untilLoadBalancer
becomesready
for the first time.- Returns:
- a retrying filter that disables automatic retries for exceptions, but still waits until
LoadBalancer
becomesready
for the first time. - See Also:
-
disableAllRetries
Retrying filter that disables any form of retry behaviour. All types of failures will not be re-attempted, includingLoadBalancer
readiness state
.- Returns:
- a retrying filter that disables any form of retry behaviour. All types of failures will not be re-attempted.
- See Also:
-
DelayedRetryException
instead.