-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Resilience4j incompatible with rxjava3 #2131
Comments
Hi, |
I've just had a look, and it looks like there is a class called |
Yes, actually I think we never implemented a RxJava3 Aspect Extension :/ |
I'll raise a PR :) Thanks. |
Do you want me to leave support for rx java 2 or remove it? It looks like that's been EOL for a few years now. |
Yes, would make sense. Thank you |
I've decided to leave rx2 there for now, as it's still a valid option. It's a pretty big PR but I think it's fairly well tested. Will get it raised tomorrow. |
Pull request raised :) It's a biggie, but hopefully nothing too controversial. |
@RobWin thanks for merging. Just so I can set some expectations, when do you think we'll be getting the next release? |
@RobWin I notice that Sonar isn't very happy. Seems to be complaining about duplicated code since my PR. Is that going to block a release? |
@RobWin Sorry to ask again, do you have any idea when this will be released? It's a bit of a blocker for us at the moment. Also, shall we close this issue, or will we close it after it gets released? |
I usually close it when it's released. But since it's an extension system, anyone can potentially provide You could basically move everything into a new module/library as a resilience4j rxjava3 springboot extension. But as said I try to release as soon as possible. |
Thanks @RobWin , that was going to be my other suggestion if you were too busy - Adding those AspectExt and FallbackDecorator to our classpath until the release is done. |
Yes. that should be possible. At least that was the design idea. |
I've just tried this out - I've added the Thanks again! |
Perfect, |
Resilience4j version:
2.2.0
Java version:
17
We're using resilience4j in our spring boot app as the circuit breaker, and using rxjava as our reactive library. We're currently trying to update rxjava2 to rxjava3. It looks to us that the circuit breaker is no longer falling back to the fallback method when an error is thrown with rxjava3. I've created a simplified project (attached) which demonstrates the problem, but here's a brief overview of the demo:
The service just returns "Success" if
throwException
is false, and returns anObservable.error
ifthrowException
is true.Our expectation is that when
throwException
is true, the fallback method should get called, and the response we get should beSingle.just("Fallback")
. The behaviour of the circuit breaker and method is verified with the tests provided:When we're using rxjava2, these tests pass as expected. However, when we change our dependencies and imports to rxjava3, the
getResult_returnsFallback_whenThrowExceptionTrue
test fails as theIllegalArgumentException
gets thrown, and isn't handled by the fallback method. ThegetResult_causesCircuitBreakerToRegisterFailedCall_whenThrowExceptionTrue
test also fails, as the circuit breaker has not recorded a failed call.The
build.gradle
shows our dependencies:and when we go from rx java 2 to rx java 3, we swap the
io.github.resilience4j:resilience4j-rxjava2:2.2.0
forio.github.resilience4j:resilience4j-rxjava3:2.2.0
and fix the imports inMyService
.Is there anything we're missing to make this work? Or is this a bug?
It's worth noting that we've tried spring boot 3 too, and the behaviour is identical.
resilience4j-rxjava.zip
The text was updated successfully, but these errors were encountered: