Description
Expected Behavior
In a Spring project, there is a very high likelyhood a Spring RestTemplate, Spring WebFlux Webclient is already on the classpath.
it will be a great improvement for this project, instead of using the default Elasticsearch Java http client, this project can use Spring RestTemplate, Spring WebFlux Webclient that is on a Spring project.
This PR opens this possibility for this project: https://github.com/elastic/elasticsearch-java/pull/584/files
Just to avoid any misunderstanding, this is not an ask to support each and every http client possible and imaginable. Both Spring RestTemplate and Spring Webflux Webclient are very common, and usually present in a default Spring, SpringBoot project. It will be great to be able to leverage those existing clients, now ElasticSearch Java allows it.
Just to avoid misunderstanding, this is not an ask to bring back to life the already deprecated High Level Rest Client https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.resthighlevelclient or the already deprecated Reactive Client https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.reactive It is to use the ElasticSearch Java, but with Spring RestTemplate, Spring Webflux Webclient, now this PR offers the possibility to do so
https://github.com/elastic/elasticsearch-java/pull/584/files
Current Behavior
Currently, Spring Data Elasticsearch uses Elasticsearch Java, which uses apache http client.
A great improvement has been made by Elasticsearch Java to allow the support of other http clients.
https://github.com/elastic/elasticsearch-java/pull/584/files
This is an equally great opportunity for this project to be able to wire the usual Spring RestTemplate / Spring WebFlux Webclient instead.
While one can do this replacement on his own, rewriting the code on the SpringBoot/Spring data elasticsearch project, it will be a great improvement if this project can help with the boiler plate code and the configuration, so the application can just configure and ready the use of the http client
Context
How has this issue affected you?
It is usual for a SpringBoot, Spring project to have a preconfigured, tested, tuned Spring RestTemplate Spring Webflux Webclient. However, this project, after the deprecations, does not allow the use of them. This recent PR from Elasticsearch Java is a game changer for Spring based elasticsearch applications.
What are you trying to accomplish?
In most of SpringBoot projects, there is a Webclient, a RestTemplate , which has preconfigured logging, monitoring, circuit breakers, etc... (all part of Spring portfolio) Being able to use those clients within Spring data elasticsearch would be a great plus. Thank you