Prev Next

Spring / Resilience4j Interview questions

What is the difference between CallNotPermittedException and other Resilience4j exceptions?

ExceptionThrown by / meaning
CallNotPermittedExceptionCircuitBreaker is OPEN; the call was never attempted.
BulkheadFullExceptionBulkhead concurrency/queue limit reached; call rejected before running.
RequestNotPermittedRateLimiter's permit timeout expired; call was never attempted.
TimeoutExceptionTimeLimiter's duration elapsed while the call was actually running.

The common thread across the first three is that they all represent the call being refused before it ever reached the real dependency - the failure is entirely local, inside Resilience4j's own gatekeeping logic.

TimeoutException is different in kind: the call did start running against the actual dependency, it just didn't finish in time, which matters when deciding whether it's safe to assume the downstream side-effect happened or not.

CallNotPermittedException, BulkheadFullException, and RequestNotPermitted have in common that:
TimeoutException from TimeLimiter differs because:

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