# Java RestHighLevelClient vs Elasticsearch Java API Client Improvements

**URL:** <https://discuss.elastic.co/t/java-resthighlevelclient-vs-elasticsearch-java-api-client-improvements/300398>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [March 23, 2022, 2:05am UTC](https://discuss.elastic.co/t/java-resthighlevelclient-vs-elasticsearch-java-api-client-improvements/300398 "2022-03-23T02:05:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashfur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashfur/32/81284_2.png) [@Ashfur](https://discuss.elastic.co/u/Ashfur)\
**Post date:** [March 23, 2022, 2:05am UTC](https://discuss.elastic.co/t/java-resthighlevelclient-vs-elasticsearch-java-api-client-improvements/300398/1 "2022-03-23T02:05:05Z")

</div>

Hello,

We are on 7.16.2 and are currently using the org.Elasticsearch.client.RestHighLevelClient. I am aware that the RestHighLevelClient has been deprecated in favor of the new Java API client. I'd just like to know if there is any functional or performance improvement that the new Java API client has over the legacy high level client. We do plan to upgrade in the future, but just want to know what are the benefits that the new client bring (besides being better maintained/updated).

Thanks.

---

<div class="post-metadata">

**Author:** ![swallez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swallez/32/11972_2.png) [@swallez](https://discuss.elastic.co/u/swallez)\
**Post date:** [March 23, 2022, 8:26am UTC](https://discuss.elastic.co/t/java-resthighlevelclient-vs-elasticsearch-java-api-client-improvements/300398/2 "2022-03-23T08:26:24Z")

</div>

Although we haven't done any formal benchmarks, performance should be similar as neither of the two clients rely on costly reflection to serialize and deserialize objects. The two clients also use the same lower level RestClient to handle http communication.

From a functional perspective, the Java API client provides a modern fluent way for building request objects and navigate complex responses, stronger typing (no `Object` values) and also a tight integration with JSON object mappers like Jackson so that you can send and retrieve application classes directly.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 20, 2022, 8:26am UTC](https://discuss.elastic.co/t/java-resthighlevelclient-vs-elasticsearch-java-api-client-improvements/300398/3 "2022-04-20T08:26:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
