Add `GrpcCircuitBreakerRule`
See original GitHub issueIf a CircuitBreakerRule
is built for gRPC clients, users might want to get grpc-status
to decide whether a call is a success or not. Normally, grpc-status
exists in the HTTP trailers of a response. However, if a call is failed, it could be in the HTTP headers of a trailers-only response. It is a transport-level protocol specification and many users may not know the details.
If we add GrpcCircuitBreakerRule
which inherits the existing CircuitBreakerRule
and add onGrpcStatus()
, users will be able to use circuit breaker with gRPC clients more easily.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Circuit Breaker with gRPC - Stack Overflow
I solved my problem by implementing the circuit-breaker on my client. I used the sentinel library. To react on exceptions ratio for example ......
Read more >gRPC - Circuit Breaker recommendations · Issue #7281 - GitHub
A circuit breaker in gRPC would just be a client interceptor (and potentially a server interceptor, depending on how the breaking is designed)....
Read more >Building a gRPC Client Standard to Boost Reliability and ...
This is done by configuring the parameters of the clients' timeouts, retry strategy, and circuit breakers. If set correctly, timeouts are ...
Read more >Introducing gRPC to our Hotels.com Platform — Part 1 - Medium
gRPC allows you to set deadlines (and you should always do so). However, you might still need a Circuit Breaker for connection back-off...
Read more >Setting up Resilience4j Circuit Breaker for Grpc Java Client
This article explains how to set up Resilience4j circuit breaker to work with a grpc client set up with grpc-spring-boot-starter.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Agreed! In addition to
onGrpcStatus()
,onGrpcTrailers()
would be a good extension method forGrpcCircuitBreakerRule
andGrpcRetryRule
.Generally I think adding
GrpcCircuitBreakerRule
with aonGrpcStatus
method is a great idea.However, it could be even better if the
GrpcCircuitBreakerRule
has a methodonGrpcTrailers(grpcTrailers: HttpHeaders)
wheregrpcTrailers
is “trailers” in the context of gRPC. Specifically,grpcTrailers
could be either HTTP headers if the response is “trailers-only” or HTTP trailers if the response has 3 parts (HTTP headers, body, and HTTP trailers).This
onGrpcTrailers(grpcTrailers: HttpHeaders)
is more generally useful because users get access to the whole gRPC trailer which must contain gRPC status (as promised by the gRPC protocol specification). Another way to think about it would be: what if users want to set up their circuit-break conditions upon other information stored in gRPC trailers other than just gRPC status?Let me know what you think. Thanks!