guava-retrying
guava-retrying copied to clipboard
Logging retry attempts before retry is cumbersome
Usecase: This is what I'd like to log:
Retrying yet another time because we failed last time...
What I could do is use a RetryListener and log as soon as an attempt failed. However, I would need access to my StopStrategy to know whether a retry will actually be executed.
Proposed solution: Have two methods on a RetryListener:
RetryListener#preAttempt(Attempt previousAttempt). Called only if an attempt is to be made.RetryListener#postAttempt(Attempt attempt). Basically the same as#onRetry.
...or can I do this easy some other way?
Has anything changed on this issue?