2

I'm looking through the docs of Resilience4j and I cannot seem to find the configuration for a time limiter.

I work in Spring Boot 2 and I use configure the setting in an application.yml. So far it looks like this:

resilience4j.circuitbreaker:
  instances:
    frap:
      registerHealthIndicator: true
      ringBufferSizeInClosedState: 3
      ringBufferSizeInHalfOpenState: 3
      waitDurationInOpenState: 10s
      failureRateThreshold: 20
      waitDuration: 10s

What property should I add to make it fail fast?

minihulk22
  • 149
  • 3
  • 14

1 Answers1

2

A @TimeLimiter annotation is not supported in Spring Boot yet. But a time limit is simple to implement. Your method must return a CompletableFuture and just invoke future.get(). That's it.

Feel free to contribute a Spring AOP Aspect ;)

https://github.com/resilience4j/resilience4j/issues/430

But keep in mind that it is better to configure a timelimit on the protocol level. For example in your HTTP client.

Robert Winkler
  • 1,734
  • 9
  • 8