Closed mjalvarez closed 2 months ago
You can't currently override maxRetries
, but you can use FailsafeExecutor.get(ContextualSupplier<>)
to make decisions about when to stop retrying based on execution Context..
You can use RetryPolicyBuilder.withDelayFn(ContextualSupplier<>)
to decisions about how long to delay based on execution context.
Gotcha. I'll play around with these alternatives. Maybe these are enough. Thanks @Tembrel ! 🙏
If I already created a retry policy of, say,
maxRetries=3
anddelay=300
, would it be possible to override that config based on the exception encountered at runtime?For example, a
CustomRuntimeException
with propertiesmaxRetries=2
anddelay=500
could override the current retry policy when thrown, such that the next attempt will be after 500ms, and that when every other Exception is encountered, the original retry policy will take effect.