@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.554Z") @Stability(value=Stable) public interface HttpRetryPolicy extends software.amazon.jsii.JsiiSerializable
Example:
// Example automatically generated from non-compiling source. May contain errors.
VirtualRouter router;
VirtualNode node;
router.addRoute("route-http2-retry", RouteBaseProps.builder()
.routeSpec(RouteSpec.http2(HttpRouteSpecOptions.builder()
.weightedTargets(List.of(WeightedTarget.builder().virtualNode(node).build()))
.retryPolicy(HttpRetryPolicy.builder()
// Retry if the connection failed
.tcpRetryEvents(List.of(TcpRetryEvent.CONNECTION_ERROR))
// Retry if HTTP responds with a gateway error (502, 503, 504)
.httpRetryEvents(List.of(HttpRetryEvent.GATEWAY_ERROR))
// Retry five times
.retryAttempts(5)
// Use a 1 second timeout per retry
.retryTimeout(Duration.seconds(1))
.build())
.build()))
.build());
| Modifier and Type | Interface and Description |
|---|---|
static class |
HttpRetryPolicy.Builder
A builder for
HttpRetryPolicy |
static class |
HttpRetryPolicy.Jsii$Proxy
An implementation for
HttpRetryPolicy |
| Modifier and Type | Method and Description |
|---|---|
static HttpRetryPolicy.Builder |
builder() |
default List<HttpRetryEvent> |
getHttpRetryEvents()
Specify HTTP events on which to retry.
|
Number |
getRetryAttempts()
The maximum number of retry attempts.
|
Duration |
getRetryTimeout()
The timeout for each retry attempt.
|
default List<TcpRetryEvent> |
getTcpRetryEvents()
TCP events on which to retry.
|
@Stability(value=Stable) @NotNull Number getRetryAttempts()
@Stability(value=Stable) @NotNull Duration getRetryTimeout()
@Stability(value=Stable) @Nullable default List<HttpRetryEvent> getHttpRetryEvents()
You must specify at least one value for at least one types of retry events.
Default: - no retries for http events
@Stability(value=Stable) @Nullable default List<TcpRetryEvent> getTcpRetryEvents()
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.
Default: - no retries for tcp events
@Stability(value=Stable) static HttpRetryPolicy.Builder builder()
HttpRetryPolicy.Builder of HttpRetryPolicyCopyright © 2022. All rights reserved.