0
@Retryable(retryFor = SQLException.class, maxAttempts = 2, backoff = @Backoff(delay = 100))
void retryServiceWithCustomization(String sql) throws SQLException;

I want to make retry for 5 secs first 60 mins . After 60 mins , retry should be every 30 mins.And No retry logic after 2 days. How Can I implement this use case for above code?

I have tried using delay and multiplier but not getting the logic

  • 2
    You would need a custom back off policy and manually configure an interceptor, passing its bean name into the annotation. However, spring-retry is not really suitable for such long delays because the thread is suspended for that time. You would be better off using custom logic with a `TaskScheduler` instead. – Gary Russell Aug 02 '23 at 16:39

0 Answers0