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

JestClient is throwing SocketTimeoutException after being idle for sometime

pkgajulapalli
1#
pkgajulapalli Published in 2018-01-13 04:07:16Z

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.309519 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO