# Max retries in Elasticsearch Java Client

**URL:** <https://discuss.elastic.co/t/max-retries-in-elasticsearch-java-client/53805>\
**Category:** Elasticsearch\
**Created:** [June 23, 2016, 4:20pm UTC](https://discuss.elastic.co/t/max-retries-in-elasticsearch-java-client/53805 "2016-06-23T16:20:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Otavio\_Goncalves\_de](https://avatars.discourse-cdn.com/v4/letter/o/ac8455/32.png) [@Otavio\_Goncalves\_de](https://discuss.elastic.co/u/Otavio_Goncalves_de)\
**Post date:** [June 23, 2016, 4:20pm UTC](https://discuss.elastic.co/t/max-retries-in-elasticsearch-java-client/53805/1 "2016-06-23T16:20:50Z")

</div>

Looking to JS client elasticsearch API, there's a documentation about max retries.  
[https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html)

In Java world, there are several configurations:

- [cluster.name](http://cluster.name)
- transport.ping\_schedule
- transport.sniff
- shield.transport.ssl
- action.bulk.compress
- request.headers.X-Found-Cluster

**My question is:** How can I configure number of max retries? And the time of wait these retries?

---

<div class="post-metadata">

**Author:** ![henrikno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henrikno/32/6948_2.png) [@henrikno](https://discuss.elastic.co/u/henrikno)\
**Post date:** [June 23, 2016, 8:31pm UTC](https://discuss.elastic.co/t/max-retries-in-elasticsearch-java-client/53805/2 "2016-06-23T20:31:03Z")

</div>

Moved from Cloud to Elasticsearch category as it's a general ES question.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [June 23, 2016, 10:34pm UTC](https://discuss.elastic.co/t/max-retries-in-elasticsearch-java-client/53805/3 "2016-06-23T22:34:06Z")

</div>

Java API on client side uses a Netty 3 boss/worker model for TCP/IP connections. Connections are established and released on demand, dynamically from the worker pool. Because of this, there is no such parameter like `max retries`.

---

<div class="post-metadata">

**Author:** ![shrenikgala](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@shrenikgala](https://discuss.elastic.co/u/shrenikgala)\
**Post date:** [April 14, 2017, 11:55pm UTC](https://discuss.elastic.co/t/max-retries-in-elasticsearch-java-client/53805/4 "2017-04-14T23:55:16Z")

</div>

So does that mean it will keep on retrying indefinitely ?

---

<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:** [July 5, 2017, 10:01pm UTC](https://discuss.elastic.co/t/max-retries-in-elasticsearch-java-client/53805/5 "2017-07-05T22:01:11Z")

</div>


