circuit breaker can be called without affecting the state.
See original GitHub issueResilience4j version: 1.3.1
Java version: 1.8
I just want to know the circuit breakers status. ex) is open or half-open and can call backend). so I used tryAcquirePermission(). but I missed the comment below.
* Important: Make sure to call onSuccess or onError after the call is finished.
* If the call is canceled before it is invoked, you have to release the permission again.
so everything is looks fine until the circuit breaker is half-open. when circuit breaker is half-open, to call tryAcquirePermission is effect permittedNumberOfCallsInHalfOpenState. ( Using this method affects this property.) if call count reached permittedNumberOfCallsInHalfOpenState, circuit breaker stuck half-open
I think need to make a method to check to call permitted a backend service. If possible, I want to make it.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Circuit Breakers and Microservices Architecture
When the circuit breaker is in the CLOSED state, all calls go through to the Supplier Microservice, which responds without any latency.
Read more >CircuitBreaker - resilience4j
The state of the CircuitBreaker changes from CLOSED to OPEN when the failure rate is equal or greater than a configurable threshold. For...
Read more >What is Circuit Breaker in Microservices? | by Dineshchandgr
Open — The circuit breaker returns an error for calls without executing the function. Half-Open — After the configured timeout period is reached,...
Read more >Polly circuitbreaker is not being called - Stack Overflow
The final line outputting circuit state demonstrates the circuit-breaker was affected by (so did take part in) the call.
Read more >Circuit breaker - Wikipedia
A circuit breaker is an electrical safety device designed to protect an electrical circuit from damage caused by an overcurrent or short circuit....
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
You can create a method like this:
The fallback can be your message to the user.
This is not how you should use the CircuitBreaker. The exception from the CircuitBreaker tells you that it is open, just map the exception to a proper response to the user. Please don’t do it that way. There is usually no need to use this CircuitBreakerUtil class.