public static final class RetryPolicy.RetryPolicyBuilder extends Object
Constructor and Description |
---|
RetryPolicyBuilder() |
Modifier and Type | Method and Description |
---|---|
RetryPolicy |
build() |
void |
setBackoffStrategy(RetryPolicy.BackoffStrategy backoffStrategy) |
void |
setFastFailRateLimiting(boolean fastFailRateLimiting) |
void |
setHonorDefaultBackoffStrategyInRetryMode(boolean honorBackOffStrategyInRetryMode) |
void |
setHonorDefaultMaxErrorRetryInRetryMode(boolean honorDefaultMaxErrorRetryInRetryMode) |
void |
setHonorMaxErrorRetryInClientConfig(boolean honorMaxErrorRetryInClientConfig) |
void |
setMaxErrorRetry(int maxErrorRetry) |
void |
setRetryCondition(RetryPolicy.RetryCondition retryCondition) |
void |
setRetryMode(RetryMode retryMode) |
RetryPolicy.RetryPolicyBuilder |
withBackoffStrategy(RetryPolicy.BackoffStrategy backoffStrategy)
Set the back-off strategy for controlling how long the next retry should wait.
|
RetryPolicy.RetryPolicyBuilder |
withFastFailRateLimiting(boolean fastFailRateLimiting)
Whether the client should fail immediately when it cannot immediately make a request because there is not enough capacity in the rate limiter.
|
RetryPolicy.RetryPolicyBuilder |
withHonorDefaultBackoffStrategyInRetryMode(boolean honorBackOffStrategyInRetryMode)
Whether the policy should honor the backoff strategy dictated by the configured retry mode.
|
RetryPolicy.RetryPolicyBuilder |
withHonorDefaultMaxErrorRetryInRetryMode(boolean honorDefaultMaxErrorRetryInRetryMode)
Whether the policy should honor the max error retries dictated by the configured retry mode.
|
RetryPolicy.RetryPolicyBuilder |
withHonorMaxErrorRetryInClientConfig(boolean honorMaxErrorRetryInClientConfig)
Set whether this retry policy should honor the max error retry set by
ClientConfiguration.setMaxErrorRetry(int) . |
RetryPolicy.RetryPolicyBuilder |
withMaxErrorRetry(int maxErrorRetry)
Set aximum number of retry attempts for failed requests.
|
RetryPolicy.RetryPolicyBuilder |
withRetryCondition(RetryPolicy.RetryCondition retryCondition)
Set the retry condition on whether a specific request and exception should be retried.
|
RetryPolicy.RetryPolicyBuilder |
withRetryMode(RetryMode retryMode)
Set the retry mode for the client.
|
public RetryPolicy.RetryPolicyBuilder withRetryCondition(RetryPolicy.RetryCondition retryCondition)
retryCondition
- The retry condition.public void setRetryCondition(RetryPolicy.RetryCondition retryCondition)
public RetryPolicy.RetryPolicyBuilder withBackoffStrategy(RetryPolicy.BackoffStrategy backoffStrategy)
backoffStrategy
- The backoff strategy.public void setBackoffStrategy(RetryPolicy.BackoffStrategy backoffStrategy)
public RetryPolicy.RetryPolicyBuilder withMaxErrorRetry(int maxErrorRetry)
maxErrorRetry
- The max retry attempts.public void setMaxErrorRetry(int maxErrorRetry)
public RetryPolicy.RetryPolicyBuilder withHonorMaxErrorRetryInClientConfig(boolean honorMaxErrorRetryInClientConfig)
ClientConfiguration.setMaxErrorRetry(int)
.honorMaxErrorRetryInClientConfig
- Whether the policy should honor the max error retry setting on the
client configuration.public void setHonorMaxErrorRetryInClientConfig(boolean honorMaxErrorRetryInClientConfig)
public RetryPolicy.RetryPolicyBuilder withRetryMode(RetryMode retryMode)
retryMode
- The retry mode.public void setRetryMode(RetryMode retryMode)
public RetryPolicy.RetryPolicyBuilder withHonorDefaultMaxErrorRetryInRetryMode(boolean honorDefaultMaxErrorRetryInRetryMode)
honorDefaultMaxErrorRetryInRetryMode
- Whether the policy should honor the max error retries dictated
by the configured retry mode.public void setHonorDefaultMaxErrorRetryInRetryMode(boolean honorDefaultMaxErrorRetryInRetryMode)
public RetryPolicy.RetryPolicyBuilder withFastFailRateLimiting(boolean fastFailRateLimiting)
Note: This configuration only has an effect when used in combination with the RetryMode.ADAPTIVE
retry mode.
fastFailRateLimiting
- Whether to fail fast.public void setFastFailRateLimiting(boolean fastFailRateLimiting)
public RetryPolicy.RetryPolicyBuilder withHonorDefaultBackoffStrategyInRetryMode(boolean honorBackOffStrategyInRetryMode)
honorBackOffStrategyInRetryMode
- Whether the policy should honor the backoff strategy dictated
by the configured retry mode.public void setHonorDefaultBackoffStrategyInRetryMode(boolean honorBackOffStrategyInRetryMode)
public RetryPolicy build()
Copyright © 2022. All rights reserved.