Prev Next

Spring / Resilience4j Interview questions

What is the difference between waitDurationInOpenState and permittedNumberOfCallsInHalfOpenState?

These two settings control different phases of recovery and are easy to conflate since they both govern "what happens after the breaker opens".

waitDurationInOpenState is a time value - how long the breaker stays fully OPEN, rejecting every call, before it's even eligible to move to HALF_OPEN and try anything again.

permittedNumberOfCallsInHalfOpenState is a count, not a time - once in HALF_OPEN, it's how many trial calls are allowed through before the breaker decides, based on their outcomes, whether to return to CLOSED or reopen.

Set together, they answer two separate questions: how long to wait before testing recovery at all, and how large a sample of real traffic to trust once that testing begins.

waitDurationInOpenState controls:
permittedNumberOfCallsInHalfOpenState is measured in:

More Related questions...

What is Resilience4j? What are the core modules of Resilience4j? What is a Circuit Breaker in Resilience4j? What are the states of a CircuitBreaker? What is the Retry module used for? What is a RateLimiter in Resilience4j? What is the Bulkhead pattern in Resilience4j? What is a TimeLimiter in Resilience4j? What is the Cache module in Resilience4j? How do you add Resilience4j to a Spring Boot project? What is the purpose of the Decorators class? Define fallback method in Resilience4j? What are the types of Bulkhead implementations? List the key configuration properties of a CircuitBreaker? How do you apply @CircuitBreaker in a Spring Boot service? Why is Resilience4j often preferred over Hystrix? How does the sliding window work in CircuitBreaker? What is the difference between COUNT_BASED and TIME_BASED sliding windows? How is failure rate calculated in a CircuitBreaker? What is the difference between CircuitBreaker and Bulkhead? How does the half-open state behave in a CircuitBreaker? Why do we use recordExceptions versus ignoreExceptions? When should you use RateLimiter instead of Bulkhead? What happens when a CircuitBreaker transitions to OPEN? How is Resilience4j's Retry different from a plain retry loop? Explain the execution flow of a call decorated with CircuitBreaker, Retry, and Bulkhead together? How do you combine multiple Resilience4j decorators using the Decorators class? Which is better and why: SemaphoreBulkhead or ThreadPoolBulkhead? How can you optimize CircuitBreaker configuration for a high-throughput service? How do you troubleshoot a CircuitBreaker that never opens despite failures? Explain the lifecycle of a CircuitBreaker instance? What is the difference between TimeLimiter and a plain timeout? How does RegistryEventConsumer work in Resilience4j? Why does Resilience4j rely on functional interfaces like Supplier and Function? How do you monitor Resilience4j metrics with Micrometer? What is the difference between waitDurationInOpenState and permittedNumberOfCallsInHalfOpenState? How do you write a unit test for a CircuitBreaker-protected method? Explain the internal working of exponential backoff in the Retry module? What is the difference between CallNotPermittedException and other Resilience4j exceptions? How do you use event publishers to log CircuitBreaker state transitions? When would you choose a RateLimiter over a Bulkhead for protecting a downstream call? How does Resilience4j integrate with reactive streams in WebFlux? What is the difference between recordException and recordResult predicates? Explain the internal working of automaticTransitionFromOpenToHalfOpenEnabled? How do you configure Resilience4j using application.yml in Spring Boot? What is the difference between the Resilience4j Cache module and a plain in-memory cache like Guava? How can you optimize retry strategies to avoid retry storms? Explain the execution flow when a fallback method itself throws an exception? How do you troubleshoot memory growth caused by an unbounded ThreadPoolBulkhead queue? Explain how Resilience4j's modular design influences microservice resilience architecture at scale?
Show more question and Answers...


Comments & Discussions