Class RetryConfig<T extends Response>
java.lang.Object
com.linecorp.armeria.client.retry.RetryConfig<T>
Holds retry config used by a
RetryingClient
.
A RetryConfig
instance encapsulates the used RetryRule
, maxTotalAttempts
,
and responseTimeoutMillisForEachAttempt
.-
Method Summary
Modifier and TypeMethodDescriptionstatic RetryConfigBuilder<HttpResponse>
Returns a newRetryConfigBuilder
with the specifiedRetryRule
.static RetryConfigBuilder<HttpResponse>
builder
(RetryRuleWithContent<HttpResponse> retryRuleWithContent) Returns a newRetryConfigBuilder
with the specifiedRetryRuleWithContent
.static RetryConfigBuilder<RpcResponse>
builderForRpc
(RetryRule retryRule) Returns a newRetryConfigBuilder
with the specifiedRetryRule
.static RetryConfigBuilder<RpcResponse>
builderForRpc
(RetryRuleWithContent<RpcResponse> retryRuleWithContent) Returns a newRetryConfigBuilder
with the specifiedRetryRuleWithContent
.int
Returns themaxContentLength
, which is non-zero only if aRetryRuleWithContent
is used.int
Returns the maximum allowed number of total attempts made by aRetryingClient
.boolean
Returns whether aRetryRuleWithContent
is being used.boolean
Returns whether the associatedRetryRule
orRetryRuleWithContent
requires response trailers.long
Returns the response timeout for each attempt in milliseconds.Returns theRetryRule
which was specified withbuilder(RetryRule)
.Returns theRetryRuleWithContent
which was specified withbuilder(RetryRuleWithContent)
.Converts thisRetryConfig
to a mutableRetryConfigBuilder
.
-
Method Details
-
builder
Returns a newRetryConfigBuilder
with the specifiedRetryRule
. -
builder
public static RetryConfigBuilder<HttpResponse> builder(RetryRuleWithContent<HttpResponse> retryRuleWithContent) Returns a newRetryConfigBuilder
with the specifiedRetryRuleWithContent
. -
builderForRpc
Returns a newRetryConfigBuilder
with the specifiedRetryRule
. -
builderForRpc
public static RetryConfigBuilder<RpcResponse> builderForRpc(RetryRuleWithContent<RpcResponse> retryRuleWithContent) Returns a newRetryConfigBuilder
with the specifiedRetryRuleWithContent
. -
toBuilder
Converts thisRetryConfig
to a mutableRetryConfigBuilder
. -
maxTotalAttempts
public int maxTotalAttempts()Returns the maximum allowed number of total attempts made by aRetryingClient
. -
responseTimeoutMillisForEachAttempt
public long responseTimeoutMillisForEachAttempt()Returns the response timeout for each attempt in milliseconds. When requests inRetryingClient
are made, corresponding responses are timed out by this value. -
retryRule
Returns theRetryRule
which was specified withbuilder(RetryRule)
. -
retryRuleWithContent
Returns theRetryRuleWithContent
which was specified withbuilder(RetryRuleWithContent)
. -
maxContentLength
public int maxContentLength()Returns themaxContentLength
, which is non-zero only if aRetryRuleWithContent
is used. -
needsContentInRule
public boolean needsContentInRule()Returns whether aRetryRuleWithContent
is being used. -
requiresResponseTrailers
public boolean requiresResponseTrailers()Returns whether the associatedRetryRule
orRetryRuleWithContent
requires response trailers.
-