# Timeout HighLevelRestClient

**URL:** <https://discuss.elastic.co/t/timeout-highlevelrestclient/127927>\
**Category:** Elasticsearch\
**Created:** [April 13, 2018, 8:08am UTC](https://discuss.elastic.co/t/timeout-highlevelrestclient/127927 "2018-04-13T08:08:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![twK](https://avatars.discourse-cdn.com/v4/letter/t/6a8cbe/32.png) [@twK](https://discuss.elastic.co/u/twK)\
**Post date:** [April 13, 2018, 8:08am UTC](https://discuss.elastic.co/t/timeout-highlevelrestclient/127927/1 "2018-04-13T08:08:42Z")

</div>

Hi,

im getting the following exception though i set the timeout to 60s:

```
java.io.IOException: listener timeout after waiting for [30000] ms
at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:663)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:222)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:194)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:488)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:474)
at org.elasticsearch.client.RestHighLevelClient.bulk(RestHighLevelClient.java:246)

```

Java snippet:

```
      client = new RestHighLevelClient(RestClient.builder(new HttpHost("gateway", 9200, "http"), new HttpHost("gateway", 9201, "http")).setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder.setConnectTimeout(60000)
            .setSocketTimeout(60000)));

```

What am i missing on the High(/Low)LevelRestclient configuration?

Best regards,

twk 🙂

---

<div class="post-metadata">

**Author:** ![pablo\_gracia](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pablo\_gracia](https://discuss.elastic.co/u/pablo_gracia)\
**Post date:** [April 13, 2018, 8:12am UTC](https://discuss.elastic.co/t/timeout-highlevelrestclient/127927/2 "2018-04-13T08:12:45Z")

</div>

@twK the .setSocketTimeout is in ms so it's ok your configuration try restarting your system i got a similar error and rebooting my system it desapeared the eroor 😛

---

<div class="post-metadata">

**Author:** ![twK](https://avatars.discourse-cdn.com/v4/letter/t/6a8cbe/32.png) [@twK](https://discuss.elastic.co/u/twK)\
**Post date:** [April 13, 2018, 8:16am UTC](https://discuss.elastic.co/t/timeout-highlevelrestclient/127927/3 "2018-04-13T08:16:49Z")

</div>

Thanks for your answer but the timeout happens after 30s (30000ms, see error snippet) though 60s (60000ms) are configured. ☹  
Restarting had no effect.

Problem solved. I missed the setMaxRetryTimeoutMillis.

---

<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:** [May 11, 2018, 8:16am UTC](https://discuss.elastic.co/t/timeout-highlevelrestclient/127927/4 "2018-05-11T08:16:56Z")

</div>

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