Enum HttpRetryEvent

java.lang.Object
java.lang.Enum<HttpRetryEvent>
software.amazon.awscdk.services.appmesh.HttpRetryEvent
All Implemented Interfaces:
Serializable, Comparable<HttpRetryEvent>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:46.092Z") @Stability(Stable) public enum HttpRetryEvent extends Enum<HttpRetryEvent>
HTTP events on which to retry.

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 Details

    • SERVER_ERROR

      @Stability(Stable) public static final HttpRetryEvent SERVER_ERROR
      HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511.
    • GATEWAY_ERROR

      @Stability(Stable) public static final HttpRetryEvent GATEWAY_ERROR
      HTTP status codes 502, 503, and 504.
    • CLIENT_ERROR

      @Stability(Stable) public static final HttpRetryEvent CLIENT_ERROR
      HTTP status code 409.
    • STREAM_ERROR

      @Stability(Stable) public static final HttpRetryEvent STREAM_ERROR
      Retry on refused stream.
  • Method Details

    • values

      public static HttpRetryEvent[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static HttpRetryEvent valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null