Spring / Resilience4j Interview questions
What is the Retry module used for?
The Retry module re-executes a call that failed or returned an undesirable result, up to a configured number of attempts, instead of surfacing a transient failure straight to the caller.
It's configured with a maxAttempts count and a waitDuration (or an IntervalFunction for backoff) between attempts, and it can target specific exception types via retryExceptions/ignoreExceptions, or specific results via a retryOnResult predicate.
It's best suited to genuinely transient problems - a dropped connection, a momentary timeout - not to failures that a repeated call has no realistic chance of fixing, since blindly retrying those just adds load to an already struggling dependency.
More Related questions...