public static final class HttpRetryPolicy.Builder
extends java.lang.Object
HttpRetryPolicy
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
HttpRetryPolicy |
build()
Builds the configured instance.
|
HttpRetryPolicy.Builder |
httpRetryEvents(java.util.List<? extends HttpRetryEvent> httpRetryEvents)
Sets the value of
HttpRetryPolicy.getHttpRetryEvents() |
HttpRetryPolicy.Builder |
retryAttempts(java.lang.Number retryAttempts)
Sets the value of
HttpRetryPolicy.getRetryAttempts() |
HttpRetryPolicy.Builder |
retryTimeout(Duration retryTimeout)
Sets the value of
HttpRetryPolicy.getRetryTimeout() |
HttpRetryPolicy.Builder |
tcpRetryEvents(java.util.List<? extends TcpRetryEvent> tcpRetryEvents)
Sets the value of
HttpRetryPolicy.getTcpRetryEvents() |
public HttpRetryPolicy.Builder retryAttempts(java.lang.Number retryAttempts)
HttpRetryPolicy.getRetryAttempts()
retryAttempts
- The maximum number of retry attempts. This parameter is required.this
public HttpRetryPolicy.Builder retryTimeout(Duration retryTimeout)
HttpRetryPolicy.getRetryTimeout()
retryTimeout
- The timeout for each retry attempt. This parameter is required.this
public HttpRetryPolicy.Builder httpRetryEvents(java.util.List<? extends HttpRetryEvent> httpRetryEvents)
HttpRetryPolicy.getHttpRetryEvents()
httpRetryEvents
- Specify HTTP events on which to retry.
You must specify at least one value
for at least one types of retry events.this
public HttpRetryPolicy.Builder tcpRetryEvents(java.util.List<? extends TcpRetryEvent> tcpRetryEvents)
HttpRetryPolicy.getTcpRetryEvents()
tcpRetryEvents
- TCP events on which to retry.
The event occurs before any processing of a
request has started and is encountered when the upstream is temporarily or
permanently unavailable. You must specify at least one value for at least
one types of retry events.this
public HttpRetryPolicy build()
HttpRetryPolicy
java.lang.NullPointerException
- if any required attribute was not provided