Home JestClient is throwing SocketTimeoutException after being idle for sometime
Reply: 0

JestClient is throwing SocketTimeoutException after being idle for sometime

user738
1#
user738 Published in May 20, 2018, 10:13 am

I'm using JEST to connect to elasticsearch in a spring-boot application. When the application is idle (doesn't send any requests to elasticsearch) for some time, then the JestClient is throwing SocketTImeoutException. I'm creating the client using a bean:

@Bean
public JestClient client() throws Exception {
    JestClientFactory factory = new JestClientFactory();
    factory.setHttpClientConfig(new HttpClientConfig
        .Builder(esURL)
        .multiThreaded(true)
        .connTimeout(60000)
        .readTimeout(60000)
        .defaultMaxTotalConnectionPerRoute(10)
        .maxTotalConnection(100).build());
    return factory.getObject();
}

Is there anything I'm missing here?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.305409 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO