JestClient is throwing SocketTimeoutException after being idle for sometime JestClient is throwing SocketTimeoutException after being idle for sometime elasticsearch elasticsearch

JestClient is throwing SocketTimeoutException after being idle for sometime


An idea I would try: look into this feature - https://github.com/searchbox-io/Jest/pull/149 - meaning, configure maxConnectionIdleTime so that the idle connections are killed before actually being used (which would result in the timeout exception you get). An example in the tests themselves: https://github.com/searchbox-io/Jest/blob/v2.0.4/jest/src/test/java/io/searchbox/client/JestClientFactoryIntegrationTest.java#L116

Regarding the value to use for it, I am not sure what is the timeout for the network socket... guessing 30 seconds. And whatever you set for the maxConnectionIdleTime it should be less than that. Maybe try to observe from the timeouts you get what idle time protects you and which not.