Class GrpcRetryPolicy
gRPC retry policy.
Inheritance
Namespace: Amazon.CDK.AWS.AppMesh
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class GrpcRetryPolicy : Object, IGrpcRetryPolicy, IHttpRetryPolicy
Syntax (vb)
Public Class GrpcRetryPolicy
Inherits Object
Implements IGrpcRetryPolicy, IHttpRetryPolicy
Remarks
ExampleMetadata: infused
Examples
VirtualRouter router;
VirtualNode node;
router.AddRoute("route-grpc-retry", new RouteBaseProps {
RouteSpec = RouteSpec.Grpc(new GrpcRouteSpecOptions {
WeightedTargets = new [] { new WeightedTarget { VirtualNode = node } },
Match = new GrpcRouteMatch { ServiceName = "servicename" },
RetryPolicy = new GrpcRetryPolicy {
TcpRetryEvents = new [] { TcpRetryEvent.CONNECTION_ERROR },
HttpRetryEvents = new [] { HttpRetryEvent.GATEWAY_ERROR },
// Retry if gRPC responds that the request was cancelled, a resource
// was exhausted, or if the service is unavailable
GrpcRetryEvents = new [] { GrpcRetryEvent.CANCELLED, GrpcRetryEvent.RESOURCE_EXHAUSTED, GrpcRetryEvent.UNAVAILABLE },
RetryAttempts = 5,
RetryTimeout = Duration.Seconds(1)
}
})
});
Synopsis
Constructors
GrpcRetryPolicy() |
Properties
GrpcRetryEvents | gRPC events on which to retry. |
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. |
Constructors
GrpcRetryPolicy()
public GrpcRetryPolicy()
Properties
GrpcRetryEvents
gRPC events on which to retry.
public GrpcRetryEvent[] GrpcRetryEvents { get; set; }
Property Value
Remarks
You must specify at least one value for at least one types of retry events.
Default: - no retries for gRPC events
HttpRetryEvents
Specify HTTP events on which to retry.
public HttpRetryEvent[] HttpRetryEvents { get; set; }
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.
public double RetryAttempts { get; set; }
Property Value
System.Double
RetryTimeout
The timeout for each retry attempt.
public Duration RetryTimeout { get; set; }
Property Value
TcpRetryEvents
TCP events on which to retry.
public TcpRetryEvent[] TcpRetryEvents { get; set; }
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