CircuitBreaker annotation does not work on methods
See original GitHub issueResilience4j version: 1.2.0 Java version: 1.8 Problem description: CircuitBreaker annotation is working when applied on methods. It works perfected when applied on class.
I am using spring-boot 2.0.2 Using resilence4j dependency: resilience4j-spring-boot2:1.2.0
I found this was working with spring-boot 1.5 and resilience4j-spring-boot:0.17.0
Example: the below one works
@Component(value = "backendAConnector")
@CircuitBreaker(name = "backendA")
public class BackendAConnector {
public String success() {
return "Hello World from backend A";
}
}
the below one doesn’t work
@Component(value = "backendAConnector")
public class BackendAConnector {
@CircuitBreaker(name = "backendA")
public String success() {
return "Hello World from backend A";
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
Resilience4j Circuit Breaker is not working - Stack Overflow
Try using the following yaml file I used the following configuration with your existing code,I used yaml instead of properties file. this seems ......
Read more >Resilience4j Tutorial with Spring Boot | Circuit Breaker, Retry ...
In this tutorial, we will implement Resilience4j with Spring boot and different modules available for it. We will see the theory part and ......
Read more >Getting Started - resilience4j
RateLimiter, Retry, CircuitBreaker and Bulkhead annotations support synchronous return types and asynchronous types like CompletableFuture and reactive types ...
Read more >Resilience4J: Circuit Breaker Implementation on Spring Boot
We will create a function with the name fallback, and register it in the @CircuitBreaker annotation. So, when the circuit breaker trips to...
Read more >A quick guide to Resilience4j with Spring Boot.
It is not applicable when the Circuitbreaker is in HALF_OPEN state. ... to add @CircuitBreaker(name="greetingClientCB") annotation to the method that is ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for the delayed response. I was calling the method incorrectly. Since resilience4j annotation are AOP based. I was calling the methods from within the BackendAConnector class. It started working when I called the function from different class and using the object as bean.
Found the issue why is was not working. Closing this.