It appears that the support for @Retryable
is not complete.
The RetryListener
API is defined but is not actually used in conjunction with @Retryable
.
A new instance of RetryTemplate
is created each time in AbstractRetryInterceptor
when a retryable operation is called but without setting a RetryListener
.
RetryPolicy retryPolicy = RetryPolicy.builder()
// ...
.build();
RetryTemplate retryTemplate = new RetryTemplate(retryPolicy);
try {
return retryTemplate.execute(new Retryable<>() {
Comment From: sbrannen
Hi @alexey-kadyrov,
Thanks for raising this issue.
The @Retryable
annotation from the Spring Retry project does indeed have a listeners
attribute, but the @Retryable
annotation in Spring Framework does not currently have such support.
Note, however, that RetryListener
is supported for programmatic usage with the RetryTemplate
.
Thus, we will discuss this within the team to decide if we wish to introduce similar functionality in @Retryable
.