Timeout HighLevelRestClient

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 :slight_smile:

@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 :stuck_out_tongue:

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

Problem solved. I missed the setMaxRetryTimeoutMillis.

1 Like

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