I get a client by the following code,
Code from : https://www.elastic.co/guide/en/elasticsearch/client/java-api/6.2/transport-client.html
// on startup
TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
.addTransportAddress(new TransportAddress(InetAddress.getByName("host1"), 9300))
.addTransportAddress(new TransportAddress(InetAddress.getByName("host2"), 9300));
// on shutdown
client.close();
I put my project on Linux,I always use 'kill pid' to close the project.So the code "client.close()" will not be executed.
Does this waste a lot of connections of es?
Does TransportClient need to be closed?