interface HttpRetryPolicy
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.AppMesh.HttpRetryPolicy |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsappmesh#HttpRetryPolicy |
![]() | software.amazon.awscdk.services.appmesh.HttpRetryPolicy |
![]() | aws_cdk.aws_appmesh.HttpRetryPolicy |
![]() | aws-cdk-lib » aws_appmesh » HttpRetryPolicy |
HTTP retry policy.
Example
declare const router: appmesh.VirtualRouter;
declare const node: appmesh.VirtualNode;
router.addRoute('route-http2-retry', {
routeSpec: appmesh.RouteSpec.http2({
weightedTargets: [{ virtualNode: node }],
retryPolicy: {
// Retry if the connection failed
tcpRetryEvents: [appmesh.TcpRetryEvent.CONNECTION_ERROR],
// Retry if HTTP responds with a gateway error (502, 503, 504)
httpRetryEvents: [appmesh.HttpRetryEvent.GATEWAY_ERROR],
// Retry five times
retryAttempts: 5,
// Use a 1 second timeout per retry
retryTimeout: Duration.seconds(1),
},
}),
});
Properties
Name | Type | Description |
---|---|---|
retry | number | The maximum number of retry attempts. |
retry | Duration | The timeout for each retry attempt. |
http | Http [] | Specify HTTP events on which to retry. |
tcp | Tcp [] | TCP events on which to retry. |
retryAttempts
Type:
number
The maximum number of retry attempts.
retryTimeout
Type:
Duration
The timeout for each retry attempt.
httpRetryEvents?
Type:
Http
[]
(optional, default: no retries for http events)
Specify HTTP events on which to retry.
You must specify at least one value for at least one types of retry events.
tcpRetryEvents?
Type:
Tcp
[]
(optional, default: no retries for tcp events)
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.