Interface IHttpRetryPolicy
HTTP retry policy.
Namespace: Amazon.CDK.AWS.AppMesh
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IHttpRetryPolicy
Syntax (vb)
Public Interface IHttpRetryPolicy
Remarks
ExampleMetadata: infused
Examples
VirtualRouter router;
VirtualNode node;
router.AddRoute("route-http2-retry", new RouteBaseProps {
RouteSpec = RouteSpec.Http2(new HttpRouteSpecOptions {
WeightedTargets = new [] { new WeightedTarget { VirtualNode = node } },
RetryPolicy = new HttpRetryPolicy {
// Retry if the connection failed
TcpRetryEvents = new [] { TcpRetryEvent.CONNECTION_ERROR },
// Retry if HTTP responds with a gateway error (502, 503, 504)
HttpRetryEvents = new [] { HttpRetryEvent.GATEWAY_ERROR },
// Retry five times
RetryAttempts = 5,
// Use a 1 second timeout per retry
RetryTimeout = Duration.Seconds(1)
}
})
});
Synopsis
Properties
HttpRetryEvents | Specify HTTP events on which to retry. |
RetryAttempts | The maximum number of retry attempts. |
RetryTimeout | The timeout for each retry attempt. |
TcpRetryEvents | TCP events on which to retry. |
Properties
HttpRetryEvents
Specify HTTP events on which to retry.
virtual HttpRetryEvent[] HttpRetryEvents { get; }
Property Value
Remarks
You must specify at least one value for at least one types of retry events.
Default: - no retries for http events
RetryAttempts
The maximum number of retry attempts.
double RetryAttempts { get; }
Property Value
System.Double
RetryTimeout
TcpRetryEvents
TCP events on which to retry.
virtual TcpRetryEvent[] TcpRetryEvents { get; }
Property Value
Remarks
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