# JestClient is throwing SocketTimeoutException after being idle for sometime

**URL:** <https://discuss.elastic.co/t/jestclient-is-throwing-sockettimeoutexception-after-being-idle-for-sometime/115312>\
**Category:** Elasticsearch\
**Created:** [January 12, 2018, 2:33pm UTC](https://discuss.elastic.co/t/jestclient-is-throwing-sockettimeoutexception-after-being-idle-for-sometime/115312 "2018-01-12T14:33:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkgajulapalli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pkgajulapalli/32/23274_2.png) [@pkgajulapalli](https://discuss.elastic.co/u/pkgajulapalli)\
**Post date:** [January 12, 2018, 2:33pm UTC](https://discuss.elastic.co/t/jestclient-is-throwing-sockettimeoutexception-after-being-idle-for-sometime/115312/1 "2018-01-12T14:33:14Z")

</div>

I'm using JEST to connect to elasticsearch in a spring-boot application. When the application goes idle 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?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 9, 2018, 2:33pm UTC](https://discuss.elastic.co/t/jestclient-is-throwing-sockettimeoutexception-after-being-idle-for-sometime/115312/2 "2018-02-09T14:33:29Z")

</div>

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