Spring / Resilience4j Interview questions
What is a TimeLimiter in Resilience4j?
TimeLimiter enforces a maximum duration on an asynchronous call, throwing a TimeoutException if the call hasn't completed once the configured timeoutDuration passes.
It's designed to work with CompletionStage or Future-returning calls rather than plain synchronous ones, since it needs an async handle it can abandon; for a synchronous call it's normally paired with a ThreadPoolBulkhead so the underlying thread can actually be interrupted.
The optional cancelRunningFuture setting controls whether the underlying future is cancelled once the timeout fires, which matters if the call would otherwise keep running in the background and waste resources even after the caller has given up on it.
More Related questions...