I am using annotation based approach - @Retryable
to do retry in spring boot application.
@Retryable(value = {DataAccessException.class, JpaSystemException.class}, maxAttempts = Integer.MAX_VALUE, backoff = @Backoff(delay = 30000))
What I want to do is, everytime it retries I want to access its current retry attempt.
I tried doing this using Java Reflection -
Retryable retryable = mth.getAnnotation(Retryable.class);
But using this I am not getting the current retry attempt. It just gives the details which are been added to the @Retryable
attribute like value
, maxAttempts
, Backoff
details
Any idea on this? Help is highly appreciated.