johanhaleby / occurrent

Unintrusive Event Sourcing Library for the JVM
https://occurrent.org
120 stars 16 forks source link

Retry strategy changes #143

Closed johanhaleby closed 10 months ago

johanhaleby commented 10 months ago

This is really strange, but it's actually correct with the current impl:

.onBeforeRetry((info, throwable) -> log.warn("Caught exception {}, will retry in {} millis", throwable.getClass().getSimpleName(), info.getBackoff().toMillis()))

onBeforeRetry should be called just before the actual retry, and not when the exception is caught! We should also have a onAfterRetry, in which you should be able to implement the logging statement above.