interface GrpcRetryPolicy
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AppMesh.GrpcRetryPolicy |
Java | software.amazon.awscdk.services.appmesh.GrpcRetryPolicy |
Python | aws_cdk.aws_appmesh.GrpcRetryPolicy |
TypeScript (source) | @aws-cdk/aws-appmesh » GrpcRetryPolicy |
gRPC retry policy.
Example
declare const router: appmesh.VirtualRouter;
declare const node: appmesh.VirtualNode;
router.addRoute('route-grpc-retry', {
routeSpec: appmesh.RouteSpec.grpc({
weightedTargets: [{ virtualNode: node }],
match: { serviceName: 'servicename' },
retryPolicy: {
tcpRetryEvents: [appmesh.TcpRetryEvent.CONNECTION_ERROR],
httpRetryEvents: [appmesh.HttpRetryEvent.GATEWAY_ERROR],
// Retry if gRPC responds that the request was cancelled, a resource
// was exhausted, or if the service is unavailable
grpcRetryEvents: [
appmesh.GrpcRetryEvent.CANCELLED,
appmesh.GrpcRetryEvent.RESOURCE_EXHAUSTED,
appmesh.GrpcRetryEvent.UNAVAILABLE,
],
retryAttempts: 5,
retryTimeout: cdk.Duration.seconds(1),
},
}),
});
Properties
Name | Type | Description |
---|---|---|
retry | number | The maximum number of retry attempts. |
retry | Duration | The timeout for each retry attempt. |
grpc | Grpc [] | gRPC events on which to retry. |
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.
grpcRetryEvents?
Type:
Grpc
[]
(optional, default: no retries for gRPC events)
gRPC events on which to retry.
You must specify at least one value for at least one types of retry events.
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.