TransportClient esClient = new TransportClient(settings);
for (String host: clusterHostList)
esClient.addTransportAddresses(new InetSocketTransportAddress(host, esPort));
- I want to create a connection which stays alive for hours in case of inactivity. So, I'm following a singleton pattern by maintaining only one connection to my cluster. However, the code where I'm invoking the client for a search, I am catching the exception (if any) caused by the connection, in which case I re-establish the connection by above code.
- The problem is that after a few minutes of inactivity, the connection times out without throwing any exception. This is causing me serious problems.