Hi,

I am evaluating Log Stash and Elastic Search for one of our requirement. I 
have to query data from Elastic Search in a Java Application. I am trying 
to use JEST to make a HTTP/REST call to ES. When I am trying to add a 
simple index in ES using Jest Client, I am 
getting "java.net.SocketTimeoutException: Read timed out" exception at the 
time of client execute statement. 

        HttpClientConfig clientConfig = new 
HttpClientConfig.Builder("http://My_Host:9200";).readTimeout(20000).multiThreaded(true).build();
        JestClientFactory factory = new JestClientFactory();
        factory.setHttpClientConfig(clientConfig);
        
        JestHttpClient jestClient = (JestHttpClient) factory.getObject();


*        jestClient.execute(new CreateIndex.Builder("myIndex").build()); // 
Here I am getting Socket Read Timeout Exception.*



Below is the full error stack trace - 


Exception in thread "main" java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:150)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at 
org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:136)
at 
org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:152)
at 
org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:270)
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:260)
at 
org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:161)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.http.impl.conn.CPoolProxy.invoke(CPoolProxy.java:138)
at com.sun.proxy.$Proxy0.receiveResponseHeader(Unknown Source)
at 
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:271)
at 
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
at 
org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:254)
at 
org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
at 
org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
at 
org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
at io.searchbox.client.http.JestHttpClient.execute(JestHttpClient.java:59)
at webservice.ESClient.main(ESClient.java:50)
Process exited with exit code 1.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/dfd99387-175c-43fb-833e-83b206ce22fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to