spring-cloud / spring-cloud-circuitbreaker

Spring Cloud Circuit Breaker API and Implementations
Apache License 2.0
328 stars 109 forks source link

Retry wait-duration config ignored when specifying wait-duration.seconds = x #179

Closed MikeMJ closed 7 months ago

MikeMJ commented 7 months ago

Resilience4j version: 2.0.2

Java version: 21

I'm using Spring Boot 3.2.0 with spring-cloud-starter-circuitbreaker-resilience4j. I've noticed the Retry custom wait duration is ignored and set to default (0.5S) if I configure it in the application.yml file like the following:

resilience4j:
  retry:
    configs:
      default:
        enable-exponential-backoff: true
        max-attempts: 8
        wait-duration:
          seconds: 2s

But if I change it to

resilience4j:
  retry:
    configs:
      default:
        enable-exponential-backoff: true
        max-attempts: 8
        wait-duration: 2s

the wait duration is picked from the config

ryanjbaxter commented 7 months ago

I wouldn't expect adding the seconds property to work. I assume wait-duration is of type Duration (it is part of Resilience4J not this project).

MikeMJ commented 7 months ago

Hmm. Then it is Intellij Idea code completion misleading me.

20231206_193722

I was already confused by the nano option