Spring 7 RetryListener
16:39 20 Jan 2026

Is it possible with Spring 7 org.springframework.core.retry.RetryListener log every failure which will be retried including actual retry count? It seems that

  • actual retry count is present in RetryState

  • only method which takes RetryState is onRetryableExecution(...)

  • but the method does not know if failure will be retried

  • method beforeRetry(...) knows that retry will be called but does not know RetryState

My goal is
- do nothing when no retry happens

- track retry events including actual retry count

spring retrytemplate