# Difference between Apache HttpClient 5 Transport and RestClient Transport

**URL:** <https://forum.opensearch.org/t/difference-between-apache-httpclient-5-transport-and-restclient-transport/14650>\
**Category:** OpenSearch Client Libraries\
**Tags:** opensearch-java\
**Created:** [June 12, 2023, 5:05pm UTC](https://forum.opensearch.org/t/difference-between-apache-httpclient-5-transport-and-restclient-transport/14650 "2023-06-12T17:05:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chintan\_patel](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@chintan\_patel](https://forum.opensearch.org/u/chintan_patel)\
**Post date:** [June 12, 2023, 5:05pm UTC](https://forum.opensearch.org/t/difference-between-apache-httpclient-5-transport-and-restclient-transport/14650/1 "2023-06-12T17:05:35Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
I am currently working on migrating from ElasticSearch version 1.7.2 to AWS OpenSearch Service (OpenSearch 2.8.0).

**Describe the issue** :  
I have an option to use either Apache HttpClient 5 Transport or RestClient Transport Java client. What is the difference between these two and which one does OpenSearch team recommends?

---

<div class="post-metadata">

**Author:** ![reta](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@reta](https://forum.opensearch.org/u/reta)\
**Post date:** [June 12, 2023, 7:23pm UTC](https://forum.opensearch.org/t/difference-between-apache-httpclient-5-transport-and-restclient-transport/14650/2 "2023-06-12T19:23:25Z")

</div>

The Apache HttpClient 5 Transport is preferable to RestClient Transport (we are going to deprecate it soon [1]). Besides just HTTP/2 support (which is coming in OpenSearch 3.0) and many other improvements, the Apache HttpClient 5 Transport has no dependencies on any OpenSearch components. If you have no strong reasons to stick to RestClient Transport, the Apache HttpClient 5 Transport is a way to go. Thank you.

[1] [[FEATURE] Deprecate `RestClientTransport` · Issue #326 · opensearch-project/opensearch-java · GitHub](https://github.com/opensearch-project/opensearch-java/issues/326)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [August 11, 2023, 7:23pm UTC](https://forum.opensearch.org/t/difference-between-apache-httpclient-5-transport-and-restclient-transport/14650/3 "2023-08-11T19:23:51Z")

</div>

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