Interface HttpRetryPolicy
- All Superinterfaces:
- software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
- GrpcRetryPolicy
- All Known Implementing Classes:
- GrpcRetryPolicy.Jsii$Proxy,- HttpRetryPolicy.Jsii$Proxy
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
           date="2025-10-29T11:15:32.351Z")
@Stability(Stable)
public interface HttpRetryPolicy
extends software.amazon.jsii.JsiiSerializable
HTTP retry policy.
 
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());
 - 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forHttpRetryPolicystatic final classAn implementation forHttpRetryPolicy
- 
Method SummaryModifier and TypeMethodDescriptionstatic HttpRetryPolicy.Builderbuilder()default List<HttpRetryEvent> Specify HTTP events on which to retry.The maximum number of retry attempts.The timeout for each retry attempt.default List<TcpRetryEvent> TCP events on which to retry.Methods inherited from interface software.amazon.jsii.JsiiSerializable$jsii$toJson
- 
Method Details- 
getRetryAttemptsThe maximum number of retry attempts.
- 
getRetryTimeoutThe timeout for each retry attempt.
- 
getHttpRetryEventsSpecify HTTP events on which to retry.You must specify at least one value for at least one types of retry events. Default: - no retries for http events 
- 
getTcpRetryEventsTCP events on which to retry.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 
- 
builder- Returns:
- a HttpRetryPolicy.BuilderofHttpRetryPolicy
 
 
-