DEV Community

Maxime Guilbert
Maxime Guilbert

Posted on • Updated on

How to disable Resilience4J?

During some tests, we found some errors related to our implementation of the Circuit Breaker with Resilience4J. So we wanted to disable it and continue our tests.

But we never found a property in the Resilience4J documentation which allow it!

Maybe we missed something, so do you know if there is a property to do it?


Alternate solution

But when we red the documentation, we saw some properties which can help to reduce the Circuit Breaker activation.

      failureRateThreshold: 100
      minimumNumberOfCalls: 100
      slidingWindowSize: 100
      waitDurationInOpenState: 1
Enter fullscreen mode Exit fullscreen mode
  • failureRateThreshold : The minimum rate of failures to activate the Circuit Breaker
  • minimumNumberOfCalls : The minimum number of calls before starting calculating the rate
  • slidingWindowSize : The number of last calls used to calculate the failure rate
  • waitDurationInOpenState : In milliseconds, the duration of the Circuit Breaker activation

By taking a high number of calls and a high rate, the Circuit Breaker will less be activated. And with a small duration of the Circuit Breaker, normally any transactions should be stopped.

Be careful, this solution is just to reduce the activation of the Circuit Breaker, it won't disable it. So if you have a huge number of transactions per second, may be it won't be enough.

Also, I never tested to have a high number for slidingWindowSize, so maybe it can have an impact on your transaction duration. The value 100 is the default value and it can be enough in a lot of cases.


Links


I hope it will help you!

Top comments (0)