elastic/elasticsearch-java

Publish the new Apache HttpClient 5 based low level client seperatly

Closed this issue ยท 11 comments

Description

Release notes for Elasticsearch 9.0 clients (https://www.elastic.co/docs/release-notes/elasticsearch/clients/java/9-0-0) suggest that users should move away from using the org.elasticsearch.client:elasticsearch-rest-client low-level client, which is now considered a legacy client, and switch to the new Apache HttpClient 5-based one.

Currently, the Rest5Client and the sniffer are both part of the elasticsearch-java. Extracting this new client and corresponding sniffer into their own jars, while keeping them compatible with the previous major versions of Elasticsearch, would be beneficial to users who were previously relying on the low-level client.

hey @marko-bekhta, is this a matter of client usability (not having Rest5Client classes appear in the autocomplete when writing RestClient code) or of client jar weight?

Hey @l-trotta ๐Ÿ‘‹๐Ÿป ๐Ÿ™‚

the client weight is a part of it yes, but the compatibility with different major Elasticsearch versions is even more important.

Assume having an app that currently relies on the low level client (https://github.com/elastic/elasticsearch/tree/main/client/rest) and has to be compatible with Elasticsearch 7/8/9. If one would replace the now legacy low level client with elasticsearch-java to use the classes from co.elastic.clients.transport.rest5_client.low_level they would potentially end up with other classes that aren't compatible across different versions of Elasticsearch.
If we'd move out the co.elastic.clients.transport.rest5_client.low_level package to it's own jar users would have almost a drop-in replacement for org.elasticsearch.client:elasticsearch-rest-client without extra weight (and just with the package name change)

For additional context -- Hibernate Search (https://github.com/hibernate/hibernate-search/) is currently relying on the low-level client (org.elasticsearch.client:elasticsearch-rest-client), and we are trying to evaluate our options with the announcement of this client becoming a "legacy client".

@marko-bekhta I get it now! the elasticsearch-rest-client is a separate package that has not been declared legacy, only the support classes in the context of the java client are. Basically elasticsearch-rest-client is part of the elasticsearch server codebase and will mostly remain stable, while when releasing the java client version 9 we decided to start moving away from that package so that we could more easily manage the transport, and also update to the most recent version of the http library.

Ohh ok I see, so the low level client in the server is not getting deprecated ๐Ÿ™‚, that's good to know! ๐Ÿ™‚

and also update to the most recent version of the http library.

that's actually also something we'd like to have ๐Ÿซฃ ๐Ÿ™‚ , but as far as I understand, there are no plans to bump the Apache client in the server jar to 5 ๐Ÿ˜•

there are no plans to bump the Apache client in the server jar to 5

I don't think so either... Let's keep this open, I'll explore which possibilities we have of exporting the Rest5Client separately. Thanks for the feedback :D

hey @marko-bekhta good news! we'll publish the new low level client separately, I don't have a timeline yet, but I'll update this as soon as I have more info :)

hi @l-trotta !
That's nice ! ๐Ÿฅณ ๐ŸŽ‰ Thanks! ๐Ÿ™‚

update, the PR for this has been merged :) hopefully this should be published as part of the 9.2 release

Nice! Thanks a lot ๐ŸŽ‰