# Use http rest client or transport client

**URL:** <https://discuss.elastic.co/t/use-http-rest-client-or-transport-client/69880>\
**Category:** Elasticsearch\
**Created:** [December 23, 2016, 7:17am UTC](https://discuss.elastic.co/t/use-http-rest-client-or-transport-client/69880 "2016-12-23T07:17:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![compasses](https://avatars.discourse-cdn.com/v4/letter/c/48db29/32.png) [@compasses](https://discuss.elastic.co/u/compasses)\
**Post date:** [December 23, 2016, 7:18am UTC](https://discuss.elastic.co/t/use-http-rest-client-or-transport-client/69880/1 "2016-12-23T07:18:00Z")

</div>

Talk to elasticsearch have two ways when developing java app, http rest client or transport client, the ports are 9200 and 9300. So anyone do some deep test on these two ways? which one is better?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 23, 2016, 8:20am UTC](https://discuss.elastic.co/t/use-http-rest-client-or-transport-client/69880/2 "2016-12-23T08:20:00Z")

</div>

TransportClient comes with lot of builders which simplifies writing your code.  
Rest Client is a low level one for now. But the team is working on it to add also builders and proper response objects. REST client works accross major versions.

TransportClient will be deprecated at some point.

My advice:

If you are doing simple things like index, search I'd recommend using REST.

---

<div class="post-metadata">

**Author:** ![compasses](https://avatars.discourse-cdn.com/v4/letter/c/48db29/32.png) [@compasses](https://discuss.elastic.co/u/compasses)\
**Post date:** [December 23, 2016, 8:34am UTC](https://discuss.elastic.co/t/use-http-rest-client-or-transport-client/69880/3 "2016-12-23T08:34:28Z")

</div>

Ok. big thanks.

---

<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:** [January 20, 2017, 8:34am UTC](https://discuss.elastic.co/t/use-http-rest-client-or-transport-client/69880/4 "2017-01-20T08:34:31Z")

</div>

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