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

On state transition not working on 1.7.1 #2157

Open
Manflack opened this issue May 10, 2024 · 1 comment
Open

On state transition not working on 1.7.1 #2157

Manflack opened this issue May 10, 2024 · 1 comment

Comments

@Manflack
Copy link

Manflack commented May 10, 2024

Resilience4j version: 1.7.1

Java version: 11

Hi team of resilience.
I had a problem with the version 1.7.1 that I don't have any way to invoke my lambda expression declared on my circuit breaker .onStateTransition.
The lambda expression declared on .onEvent works.

CircuitBreakerRegistry circuitBreakerRegistry = CircuitBreakerRegistry.of(circuitBreakerConfig);
CircuitBreaker circuitBreaker = circuitBreakerRegistry.circuitBreaker("myCircuitBreaker");
circuitBreaker.getEventPublisher()
.onStateTransition(this::handleTransitionEvent);

I tried many different things such review the CircuitBreaker instance (I use Beans to declare the CircuitBreakerConfig and CircuitBreaker, and another beans to put in the context of my rest template instance, I used an ClientHttpRequestInterceptor for it.
Used DependsOn, Lazy, and check if the problem is that my spring boot application use proxies (i understand this is true, idk).

And the only solution that immediately fix my problem was downgrade the version to 1.7.0.

I removed all annotations like DependsOn, Lazy to instantiate the beans and its still work.

I can do if u guys wanna it, debug my application to understand this. But idk how i can do by myself and extract relevant things.

So, I hope this experience helps to another ones that has this problem and saving four-days investigation in the web and best friend ChatGPT.

Hopes, Manflack


10/05/24 - The dependency used was resilience4j-circuitbreaker.

@RobWin
Copy link
Member

RobWin commented May 20, 2024

Hi,
can you show me some more code?
What happens if you just invoke circuitBreaker.transitionToOpenState()?

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

2 participants