I am new to circuit breakers and have recently implemented them in one of my services. I was going through the documentation Resilience 4J official documentation and found two properties that we can configure for circuit breakers.
- slidingWindowSize
- minimumNumberOfCalls
Both the above properties specify the number of calls that must be made to the services to determine whether the circuit breaker should remain open or should be closed. I need to understand the subtle difference between the two properties and any relationship that they might have with each other? Should they be configured irrespective of each other or should there be a relation between the two?
Also, is there a relationship between the above two and permittedNumberOfCallsInHalfOpenState
. For instance, if I am configuring permittedNumberOfCallsInHalfOpenState
as 5 but my slidingWindowSize
/minimumNumberOfCalls
are configured as 10, then how will the circuit breaker state be re-validated? Because it needs a minimum of 10 requests before it could re-evaluate the new state for circuit breaker but we are permitting only 5 requests when it is in open-state?