Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@CircuitBreaker not working on method inside spring boot service #2150

Open
tuanlinh281 opened this issue Apr 24, 2024 · 0 comments
Open

@CircuitBreaker not working on method inside spring boot service #2150

tuanlinh281 opened this issue Apr 24, 2024 · 0 comments

Comments

@tuanlinh281
Copy link

Resilience4j version: 1.7.1

Java version: 17

Spring boot version: 2.3.12.RELEASE

I'm having the configuration in yaml file like this
resilience4j:
circuitbreaker:
instances:
testService:
slidingWindowSize: 100
permittedNumberOfCallsInHalfOpenState: 10
slidingWindowType: TIME_BASED
minimumNumberOfCalls: 20
waitDurationInOpenState: 50s
failureRateThreshold: 50
slowCallRateThreshold: 50
slowCallDurationThreshold: 50s
and pom file with resilience4j-spring-boot2, resilience4j-circuitbreaker, spring-boot-starter-aop, spring-boot-starter-actuator, spring-boot-starter-web dependencies.
I'm putting the annotation on the service's method process()
@CIRCUITBREAKER(name = "testService", fallbackMethod = "onFailure")
and I define method onFailure with parameters like method process() plus parameter Throwable.
Inside process() method I use Thread.sleep() to delay the response in 70s but the fallback method is not invoked. Could somebody please check for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant