Class AbstractRetryingClientBuilder<O extends Response>
java.lang.Object
com.linecorp.armeria.client.retry.AbstractRetryingClientBuilder<O>
- Direct Known Subclasses:
RetryingClientBuilder
,RetryingRpcClientBuilder
public abstract class AbstractRetryingClientBuilder<O extends Response> extends Object
Builds a new
AbstractRetryingClient
or its decorator function.-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractRetryingClientBuilder(RetryStrategy retryStrategy)
Creates a new builder with the specifiedRetryStrategy
.protected
AbstractRetryingClientBuilder(RetryStrategyWithContent<O> retryStrategyWithContent)
Creates a new builder with the specifiedRetryStrategyWithContent
. -
Method Summary
Modifier and Type Method Description AbstractRetryingClientBuilder<O>
maxTotalAttempts(int maxTotalAttempts)
Sets the maximum number of total attempts.AbstractRetryingClientBuilder<O>
responseTimeoutForEachAttempt(Duration responseTimeoutForEachAttempt)
Sets the response timeout for each attempt.AbstractRetryingClientBuilder<O>
responseTimeoutMillisForEachAttempt(long responseTimeoutMillisForEachAttempt)
Sets the response timeout for each attempt in milliseconds.String
toString()
-
Constructor Details
-
AbstractRetryingClientBuilder
Creates a new builder with the specifiedRetryStrategy
. -
AbstractRetryingClientBuilder
Creates a new builder with the specifiedRetryStrategyWithContent
.
-
-
Method Details
-
maxTotalAttempts
Sets the maximum number of total attempts. If unspecified, the value fromFlags.defaultMaxTotalAttempts()
will be used.- Returns:
this
to support method chaining.
-
responseTimeoutMillisForEachAttempt
public AbstractRetryingClientBuilder<O> responseTimeoutMillisForEachAttempt(long responseTimeoutMillisForEachAttempt)Sets the response timeout for each attempt in milliseconds. When requests inAbstractRetryingClient
are made, corresponding responses are timed out by this value.0
disables the timeout. It will be set by the default value inFlags.defaultResponseTimeoutMillis()
, if the client dose not specify.- Returns:
this
to support method chaining.- See Also:
- Per-attempt timeout
-
responseTimeoutForEachAttempt
public AbstractRetryingClientBuilder<O> responseTimeoutForEachAttempt(Duration responseTimeoutForEachAttempt)Sets the response timeout for each attempt. When requests inAbstractRetryingClient
are made, corresponding responses are timed out by this value.0
disables the timeout.- Returns:
this
to support method chaining.- See Also:
- Per-attempt timeout
-
toString
-