GrpcRetryPolicy Struct
gRPC retry policy.
Example
ts
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: Duration.seconds(1),
},
}),
});
Properties
grpcRetryEventsoptionalGrpcRetryEvent[]grpc_retry_eventsoptionaltyping.List[GrpcRetryEvent]grpcRetryEventsoptionalList<GrpcRetryEvent>GrpcRetryEventsoptionalGrpcRetryEvent[]GrpcRetryEventsoptional*[]GrpcRetryEvent#gRPC events on which to retry.
Default: no retries for gRPC events
You must specify at least one value for at least one types of retry events.
httpRetryEventsoptionalHttpRetryEvent[]http_retry_eventsoptionaltyping.List[HttpRetryEvent]httpRetryEventsoptionalList<HttpRetryEvent>HttpRetryEventsoptionalHttpRetryEvent[]HttpRetryEventsoptional*[]HttpRetryEvent#Specify HTTP events on which to retry.
Default: no retries for http events
You must specify at least one value for at least one types of retry events.
retryAttemptsnumberretry_attemptsint | floatretryAttemptsNumberRetryAttemptsdoubleRetryAttempts*float64required#The maximum number of retry attempts.
retryTimeoutDurationretry_timeoutDurationretryTimeoutDurationRetryTimeoutDurationRetryTimeoutDurationrequired#The timeout for each retry attempt.
tcpRetryEventsoptionalTcpRetryEvent[]tcp_retry_eventsoptionaltyping.List[TcpRetryEvent]tcpRetryEventsoptionalList<TcpRetryEvent>TcpRetryEventsoptionalTcpRetryEvent[]TcpRetryEventsoptional*[]TcpRetryEvent#TCP events on which to retry.
Default: no retries for tcp events
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.