• Spring Boot Version: ≥2.4.x
  • Error:
reactor.core.publisher.Operators: Operator called default onErrorDropped

reactor.core.Exceptions$ErrorCallbackNotImplemented: org.springframework.data.elasticsearch.client.NoReachableHostException: Host 'localhost:9200' not reachable. Cluster state is offline.
Caused by: org.springframework.data.elasticsearch.client.NoReachableHostException: Host 'localhost:9200' not reachable. Cluster state is offline.
... ...
  • Current solution:(Inconvenient)
spring:
  autoconfigure:
    exclude: 
      - org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRestClientAutoConfiguration

Comment From: bclozel

This auto-configuration is triggered because your application depends on "org.springframework.data:spring-data-elasticsearch" (and all the other required bits, like reactor netty).

Could you share a bit more about your use case and why your application has that dependency on the classpath but does not intend to use the client? Such information could help us figure out how we could refine the conditions on that auto-configuration.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

Comment From: Heatmanofurioso

Hi

I also have this issue. I would like to use Spring Data Elasticsearch, but without reactive. But I am forced to use the workaround suggested by Exrick since adding the spring-data-elasticsearch starter automatically enables reactive

Comment From: wilkinsona

I think the same question that @bclozel asked above applies here too. If you do not want to use reactive, why do you have Spring WebFlux and Reactor Netty on the classpath? They aren't part of spring-boot-starter-data-elasticsearch.

Comment From: Heatmanofurioso

I use Reactive in other endpoints, not related with Elasticsearch.

We want to migrate those eventually, but we don't have the time-budget to do and test it all right now

Comment From: wilkinsona

Thanks. We don't recommend mixing reactive and blocking data access. It needs to be done with a great deal of care to avoid blocking all of the event loop's threads. I think that excluding ReactiveElasticsearchRestClientAutoConfiguration is the right thing to do in your situation.

Comment From: Heatmanofurioso

I really do not wish to have them mixed, and it's one of the things I noted right after joining this project. We're slowly pushing towards consistency :)

That being said. Thanks for clarifying