Restclient fails with concurrent.TimeoutException Exception

Indexing is failing with following exception . I am using Elastic Search REST client 5.6.4 and Elastic Server 5.6.4.
I saw a similar post , but no resolution given . can i get some pointers ?

Caused by: java.util.concurrent.TimeoutException
at org.apache.apache.http.nio.pool.AbstractNIOConnPool.processPendingRequest(
at org.apache.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.requestConnection(
at org.apache.apache.http.impl.nio.client.AbstractClientExchangeHandler.requestConnection(
at org.apache.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.start(
at org.apache.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(
at org.apache.elasticsearch.client.RestClient.performRequestAsync(
at org.apache.elasticsearch.client.RestClient.performRequestAsync(
at org.apache.elasticsearch.client.RestClient.performRequest(

Hi Vyas,

Can you post the relevant part of our code (initialization and index operation)? That would help someone to try to figure out what's happening.

Also, can you check if you are connecting in the elasticsearch port (default 9200)?


Hi Luiz

we initialize rest (Singleton) rest client,

public static Client getRestClient() {
ADFContext context = ADFContext.getCurrent();
if (context != null) {
Map<String, Object> applicationScope = context.getApplicationScope()
Client client = (Client)applicationScope.get(REST_CLIENT_CACHE_KEY);
if (client == null) {
client = cacheRestClient(applicationScope);
return client;
return null;

yes we use default port , 9200.

Hi Vyas,

I didn't get your point precisely. I have one example on how to initialize the low level REST client and perform one index operation in my gist.

Does it work for you?

Also, you can find more detailed information in this doc page.


Ok , this is what i am doing . No timeout parameters are changed.

public static Client getRestClient(HttpHost host) {
RestClientBuilder builder = RestClient.builder(host);
return new Client(, host);
Note: Above exception is consistent seen all the them time. And we have only 1 Node.

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