Added util class to determine whether Circuit Breaker permits calls
See original GitHub issueGiven you have use case where there’s need to check Circuit Breaker state before call and consider it only if it’s able to operate on underlying service.
There’s a possibility to check state of Circuit Breaker first:
boolean canBeUsed = circuitBreaker.getState().allowPublish
All states represents this flag correctly except OPEN
, which should be false
, but currently is true
.
Reference:
Real life example: You have list of services behind Circuit Breaker being used in Round-Robin manner. You don’t want to distribute load over service instances that are not operative to not waste time to call Circuit Breaker and doing unnecessary Retry (state is known ahead).
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Java/Spring: How to find what error opened the Resilence4J ...
I am using the Resilence4j circuit breaker with Spring Boot as shown below: import io.github.resilience4j.circuitbreaker.annotation.
Read more >Implementing a Circuit Breaker with Resilience4j - Reflectoring
The idea of circuit breakers is to prevent calls to a remote service if we know that the call is likely to fail...
Read more >Circuit Breaker - Documentation - Akka
The Akka library provides an implementation of a circuit breaker called CircuitBreaker CircuitBreaker which has the behavior described below. What do they do?...
Read more >CircuitBreaker - resilience4j
The CircuitBreaker uses a sliding window to store and aggregate the outcome of calls. You can choose between a count-based sliding window and...
Read more >Electric Panel Upgrade - City of Palo Alto
This page helps you understand how to determine whether or not your ... In the City of Palo Alto, building permits are handled...
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
No, DISABLED means that the CircuitBreaker is disabled. That means the backend instance is not tracked anymore. But the backend instance could be available. All calls are permitted when the CircuitBreaker is disabled.
Thanks