Interface HttpRouteSpecOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable, RouteSpecOptionsBase
All Known Implementing Classes:
HttpRouteSpecOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-12-17T21:37:26.250Z") @Stability(Stable) public interface HttpRouteSpecOptions extends software.amazon.jsii.JsiiSerializable, RouteSpecOptionsBase
Properties specific for HTTP Based Routes.

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());
 
  • Method Details

    • getWeightedTargets

      @Stability(Stable) @NotNull List<WeightedTarget> getWeightedTargets()
      List of targets that traffic is routed to when a request matches the route.
    • getMatch

      @Stability(Stable) @Nullable default HttpRouteMatch getMatch()
      The criterion for determining a request match for this Route.

      Default: - matches on '/'

    • getRetryPolicy

      @Stability(Stable) @Nullable default HttpRetryPolicy getRetryPolicy()
      The retry policy.

      Default: - no retry policy

    • getTimeout

      @Stability(Stable) @Nullable default HttpTimeout getTimeout()
      An object that represents a http timeout.

      Default: - None

    • builder

      @Stability(Stable) static HttpRouteSpecOptions.Builder builder()
      Returns:
      a HttpRouteSpecOptions.Builder of HttpRouteSpecOptions