Class RetryConfig<T extends Response>
java.lang.Object
com.linecorp.armeria.client.retry.RetryConfig<T>
public final class RetryConfig<T extends Response> extends Object
Holds retry config used by a
RetryingClient
.
A RetryConfig
instance encapsulates the used RetryRule
, maxTotalAttempts
,
and responseTimeoutMillisForEachAttempt
.-
Method Summary
Modifier and Type Method Description static RetryConfigBuilder<HttpResponse>
builder(RetryRule retryRule)
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
maxContentLength()
Returns themaxContentLength
, which is non-zero only if aRetryRuleWithContent
is used.int
maxTotalAttempts()
Returns the maximum allowed number of total attempts made by aRetryingClient
.boolean
needsContentInRule()
Returns whether aRetryRuleWithContent
is being used.boolean
requiresResponseTrailers()
Returns whether the associatedRetryRule
orRetryRuleWithContent
requires response trailers.long
responseTimeoutMillisForEachAttempt()
Returns the response timeout for each attempt in milliseconds.RetryRule
retryRule()
Returns theRetryRule
which was specified withbuilder(RetryRule)
.RetryRuleWithContent<T>
retryRuleWithContent()
Returns theRetryRuleWithContent
which was specified withbuilder(RetryRuleWithContent)
.RetryConfigBuilder<T>
toBuilder()
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.
-