guava-retrying icon indicating copy to clipboard operation
guava-retrying copied to clipboard

Logging retry attempts before retry is cumbersome

Open JensRantil opened this issue 10 years ago • 1 comments

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?

JensRantil avatar Aug 24 '15 15:08 JensRantil

Has anything changed on this issue?

fw-aaron avatar Jan 15 '20 15:01 fw-aaron