SocketTimeoutException with JEST client on java

Exception while executing query { java.net.SocketTimeoutException: Read timed out|at java.net.SocketInputStream.socketRead0(Native Method)|at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)|at java.net.SocketInputStream.read(SocketInputStream.java:170)|at java.net.SocketInputStream.read(SocketInputStream.java:141)|at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)|at sun.security.ssl.InputRecord.read(InputRecord.java:503)|at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)|at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:284)|at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:140)|at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)|at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:261)|at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:165)|at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:167)|at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:272)|at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:124)|at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271)|at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)|at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)|at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)|at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)|at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)|at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)|at io.searchbox.client.http.JestHttpClient.execute(JestHttpClient.java:50)|at com.abcd.xyz.atsdms.adapters.JestClientAdapter.fetchDocuments(JestClientAdapter.java:56)|at com.abcd.xyz.atsdms.activities.GetLineChartImageActivity.enact(GetLineChartImageActivity.java:81)|at com.abcd.jklmn.reflect.$2039.invoke(Unknown Source)|at com.abcd.jklmn.service.aaa.AAAClientProgramActivityInterceptor.intercept(AAAClientProgramActivityInterceptor.java:53)|at com.abcd.jklmn.reflect.invoke.InterceptedInvoker.invoke(InterceptedInvoker.java:74)|at com.abcd.jklmn.validate.ValidationInterceptor.intercept(ValidationInterceptor.java:106)|at com.abcd.jklmn.reflect.invoke.InterceptedInvoker.invoke(InterceptedInvoker.java:74)|at com.abcd.jklmn.service.RequestLoggingInterceptor.intercept(RequestLoggingInterceptor.java:119)|at com.abcd.jklmn.reflect.invoke.InterceptedInvoker.invoke(InterceptedInvoker.java:74)|at com.abcd.jklmn.service.DefaultActivityInvoker.invoke(DefaultActivityInvoker.java:42)|at com.abcd.jklmn.service.ContinuationActivityInvokerFactory$1.invoke(ContinuationActivityInvokerFactory.java:89)|at com.abcd.jklmn.service.InstallInterceptorHelper.invoke(InstallInterceptorHelper.java:68)|at com.abcd.jklmn.service.ActivityContinuationHandler.invoke(ActivityContinuationHandler.java:120)|at com.abcd.jklmn.service.ActivityContinuationHandler.before(ActivityContinuationHandler.java:90)|at com.abcd.jklmn.service.ActivityHandler.before(ActivityHandler.java:59)|at com.abcd.jklmn.service.TransmutingContinuationHandler.before(TransmutingContinuationHandler.java:53)|at com.abcd.jklmn.service.Chain.componenteBefore(Chain.java:111)|at com.abcd.jklmn.service.Chain.before(Chain.java:89)|at com.abcd.jklmn.service.helper.ChainHelper.before(ChainHelper.java:103)|at com.abcd.jklmn.service.AbstractOrchestrator.doWork(AbstractOrchestrator.java:59)|at com.abcd.jklmn.service.PassiveOrchestrator.enqueue(PassiveOrchestrator.java:95)|at com.abcd.jklmn.service.GracefulShutdownOrchestrator.enqueue(GracefulShutdownOrchestrator.java:309)|at com.abcd.jklmn.service.helper.OrchestratorHelper.enqueue(OrchestratorHelper.java:74)|at com.abcd.jklmn.service.batch.BatchProtocolOrchestrator.enqueue(BatchProtocolOrchestrator.java:105)|at

It fails for 4-5 times and then execute successfully.

    private final JestClient client;

    factory.setHttpClientConfig(new HttpClientConfig.Builder(endpoint).connTimeout(60000).readTimeout(60000).multiThreaded(true).build());
    this.client = factory.getObject()

I have only one client created when service starts and I use the same client for all request. Right now I am the only one who is sending request on this client.

I think i already have very high timeout set.
When i start execution, it immediately starts failing well before 60 seconds(which i atleast expect should be 60 seconds)

My curl command works finw, its only through jest client i face this issue.
I am using jest - Jest-0.1.6.

Can anyone please help me with what wrong going here ?

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