@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.554Z") @Stability(value=Stable) public enum HttpRetryEvent extends Enum<HttpRetryEvent>
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());
| Enum Constant and Description |
|---|
CLIENT_ERROR
HTTP status code 409.
|
GATEWAY_ERROR
HTTP status codes 502, 503, and 504.
|
SERVER_ERROR
HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511.
|
STREAM_ERROR
Retry on refused stream.
|
| Modifier and Type | Method and Description |
|---|---|
static HttpRetryEvent |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static HttpRetryEvent[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Stability(value=Stable) public static final HttpRetryEvent SERVER_ERROR
@Stability(value=Stable) public static final HttpRetryEvent GATEWAY_ERROR
@Stability(value=Stable) public static final HttpRetryEvent CLIENT_ERROR
@Stability(value=Stable) public static final HttpRetryEvent STREAM_ERROR
public static HttpRetryEvent[] values()
for (HttpRetryEvent c : HttpRetryEvent.values()) System.out.println(c);
public static HttpRetryEvent valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2022. All rights reserved.