P3arl
P3arl

Reputation: 391

Resilience4j different retryAttempts on different exceptions

I want to retry different number of times on different exceptions. Is it possible with resilience4j retry with yaml or custom configuration. I tried searching for their documentation and other blogs but did not find any info. For example, I want to retry 1 time for TokenException and 3 times for serverRetryableException.

resilience4j.retry:
  configs:
    default:
      maxRetryAttempts: 3
      waitDuration: 2000
      retryExceptions:
        - com.lulu.social.exception.TokenException
        - com.lulu.social.exception.ServerRetryableException

Note: I am using resilienc4j 2.1.0 with spring boot 2.7.9

Upvotes: 0

Views: 68

Answers (0)

Related Questions