@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-28T21:34:27.834Z") public enum HttpRetryEvent extends java.lang.Enum<HttpRetryEvent>
Example:
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(java.lang.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.
|
public static final HttpRetryEvent SERVER_ERROR
public static final HttpRetryEvent GATEWAY_ERROR
public static final HttpRetryEvent CLIENT_ERROR
public static final HttpRetryEvent STREAM_ERROR
public static HttpRetryEvent[] values()
for (HttpRetryEvent c : HttpRetryEvent.values()) System.out.println(c);
public static HttpRetryEvent valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null