Interface GrpcRetryPolicy

All Superinterfaces:
HttpRetryPolicy, software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
GrpcRetryPolicy.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:46.065Z") @Stability(Stable) public interface GrpcRetryPolicy extends software.amazon.jsii.JsiiSerializable, HttpRetryPolicy
gRPC retry policy.

Example:

 VirtualRouter router;
 VirtualNode node;
 router.addRoute("route-grpc-retry", RouteBaseProps.builder()
         .routeSpec(RouteSpec.grpc(GrpcRouteSpecOptions.builder()
                 .weightedTargets(List.of(WeightedTarget.builder().virtualNode(node).build()))
                 .match(GrpcRouteMatch.builder().serviceName("servicename").build())
                 .retryPolicy(GrpcRetryPolicy.builder()
                         .tcpRetryEvents(List.of(TcpRetryEvent.CONNECTION_ERROR))
                         .httpRetryEvents(List.of(HttpRetryEvent.GATEWAY_ERROR))
                         // Retry if gRPC responds that the request was cancelled, a resource
                         // was exhausted, or if the service is unavailable
                         .grpcRetryEvents(List.of(GrpcRetryEvent.CANCELLED, GrpcRetryEvent.RESOURCE_EXHAUSTED, GrpcRetryEvent.UNAVAILABLE))
                         .retryAttempts(5)
                         .retryTimeout(Duration.seconds(1))
                         .build())
                 .build()))
         .build());