Package io.servicetalk.client.api
Class DefaultAutoRetryStrategyProvider.Builder
- java.lang.Object
-
- io.servicetalk.client.api.DefaultAutoRetryStrategyProvider.Builder
-
- Enclosing class:
- DefaultAutoRetryStrategyProvider
public static final class DefaultAutoRetryStrategyProvider.Builder extends java.lang.Object
A builder forDefaultAutoRetryStrategyProvider
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AutoRetryStrategyProvider
build()
Builds a newAutoRetryStrategyProvider
.DefaultAutoRetryStrategyProvider.Builder
disableRetryAllRetryableExceptions()
Connection closures (by the peer or locally) and new requests may happen concurrently.DefaultAutoRetryStrategyProvider.Builder
disableWaitForLoadBalancer()
By default, automatic retries wait for the associatedLoadBalancer
to be ready before triggering a retry for requests.DefaultAutoRetryStrategyProvider.Builder
ignoreServiceDiscovererErrors()
By default,auto-retry strategies
fail a request if the last signal from the associatedServiceDiscoverer
was an error.DefaultAutoRetryStrategyProvider.Builder
maxRetries(int maxRetries)
Updates maximum number of automatic retries done for any request.
-
-
-
Method Detail
-
disableWaitForLoadBalancer
public DefaultAutoRetryStrategyProvider.Builder disableWaitForLoadBalancer()
By default, automatic retries wait for the associatedLoadBalancer
to be ready before triggering a retry for requests. This behavior may add latency to requests till the time the load balancer is ready instead of failing fast. This method disables the default behavior.- Returns:
this
.
-
ignoreServiceDiscovererErrors
public DefaultAutoRetryStrategyProvider.Builder ignoreServiceDiscovererErrors()
By default,auto-retry strategies
fail a request if the last signal from the associatedServiceDiscoverer
was an error. This method disables that behavior.- Returns:
this
.
-
disableRetryAllRetryableExceptions
public DefaultAutoRetryStrategyProvider.Builder disableRetryAllRetryableExceptions()
Connection closures (by the peer or locally) and new requests may happen concurrently. This means that it is possible for aLoadBalancer
to select a connection which is already closed (concurrently) but the close signal has not yet been seen by theLoadBalancer
. In such cases, requests fail with aRetryableException
. By default, automatic retries always retries theseRetryableException
s. This method disables the default behavior.- Returns:
this
.
-
maxRetries
public DefaultAutoRetryStrategyProvider.Builder maxRetries(int maxRetries)
Updates maximum number of automatic retries done for any request.- Parameters:
maxRetries
- Maximum number of automatic retries done for any request.- Returns:
this
.
-
build
public AutoRetryStrategyProvider build()
Builds a newAutoRetryStrategyProvider
.- Returns:
- A new
AutoRetryStrategyProvider
.
-
-