Spring / Resilience4j Interview questions
List the key configuration properties of a CircuitBreaker?
- failureRateThreshold - percentage of failed calls that trips the breaker to OPEN.
- slowCallRateThreshold / slowCallDurationThreshold - treat calls slower than a duration as failures too.
- slidingWindowType / slidingWindowSize - COUNT_BASED or TIME_BASED window used to compute the rate.
- minimumNumberOfCalls - minimum calls recorded before the failure rate is even evaluated.
- waitDurationInOpenState - how long the breaker stays OPEN before trying HALF_OPEN.
- permittedNumberOfCallsInHalfOpenState - trial calls allowed while HALF_OPEN.
- recordExceptions / ignoreExceptions - which thrown exceptions count as failures.
These are typically set per named instance under resilience4j.circuitbreaker.instances.<name> in application.yml, or programmatically via CircuitBreakerConfig.custom().
More Related questions...