Skip to content
Advertisement

How to configure delay time in Spring-retry (Spring Boot)

Is it possible to configure the @Retryable ? This methods (getCurrentRate) will be invoked 3 times. At first is 5 min, after that 10 min, lastly 15 min. How can I configure that ?

JavaScript

Example

JavaScript

Advertisement

Answer

You can achieve that with this configuration:

JavaScript

Invocations:

  1. After 5m ~ Delay = 300000
  2. After 10m ~ Delay = 300000 * 2 = 600000
  3. After 15m ~ Delay = 600000 * 2 = 1200000 with Max Delay of 900000
Advertisement