-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
Neo4j reactive health indicator is preferred when Reactor is on the classpath #24838
Comments
Thanks for the report but I don't think this analysis is accurate.
Unfortunately, it doesn't matter that it is a transitive dependency. Once Reactor is on the classpath, a number of available integrations will be enabled, including Neo4j. In the case of Neo4j, the new This was raised before and there are some ideas we'd like to explore in #22692. In the meantime you can either exclude reactor from your project or you can opt-in for the imperative variant of the health indicator by registering a bean for it: @Bean
public Neo4jHealthIndicator neo4jHealthContributor(Driver driver) {
return new Neo4jHealthIndicator(driver);
} Let us know how it goes. |
Thanks for pointing it out, I will check the issue. Btw, this is not blocking my project, in fact, we are migrating from the older version and as part of the migrating process we needed to check the new code against the old version and that's when I came upon this. I think that, for now, I will remove Spring Integration Test dependency (not using it) and keep a note on what you said on how to force the Imperative variant of the Health Indicator. Yeah, looking on the classpath for the Reactor library is not only limited but I think is also fragile. Having to registrate a Bean to specifically opt-in for the imperative infra don't look good to me but I understand it's what we have to work with for now :) |
Alright, thanks for the quick follow-up. Closing as a duplicate of #22692. |
One last question: is there any way I could help you solve that issue? It looks like an interesting problem but from my understanding of Spring internals, it looks too obscure to me to even know what should I change. |
Thanks for asking and offering to help. The issue I've linked to has |
Thanks for the quick reply. Yeah, that's what I've read in the description and it looks nice. Have a good day! :) |
Hi,
This issue is related to spring-projects/spring-data-neo4j#2116
I have a project that uses Spring Boot 2.4.1 and Neo4J as a database. I also use Spring Data Neo4j 6.0. Right now we are migrating from Neo4j v3.5 to v4.2.
When I try to connect to the older version I get the following exception:
I don't use Reactor in my project but it's in the classpath as a transitive dependency, in this case, coming from Spring Integration Test (yeah, I know it should be scoped as a test dependency but that's not the matter, any other dependency that brings Reactor would produce the same bug).
After researching for a while I found that Spring Actuator, as part of its Health Check process, checks for Reactor in the classpath like this in HealthEndpointConfiguration class:
This piece of code has a huge impact because it instantiates an AdaptedReactiveHealthContributors that ends up querying the database as a Reactive component when the old version of Neo4j doesn't support reactive API.
Here's the commit that adds the check
ae5ae72
The text was updated successfully, but these errors were encountered: