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.103.1 (build bef2dea)",
date="2024-10-05T03:43:38.671Z")
@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 Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forHttpRetryPolicy
static final class
An implementation forHttpRetryPolicy
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpRetryPolicy.Builder
builder()
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
-
getRetryAttempts
The maximum number of retry attempts. -
getRetryTimeout
The timeout for each retry attempt. -
getHttpRetryEvents
Specify 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
-
getTcpRetryEvents
TCP 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.Builder
ofHttpRetryPolicy
-