I'm using the below code to get a singleton object for TransportClient
object. I'm using the getInstance() to get the client object which is
already alive in webapplication.
public static Client getInstance()
if (instance == null)
logger.debug("the client instance is null, creating a new instance");
ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder();
instance = new TransportClient(settings)
logger.debug("returning the new created client instance...");
Calling the client as below from search api.
Client client = ESClientFactory.getInstance();
Now the issue is if I don't close client like client.close() I'm getting
memory leak warning from webserver tomcat side. If I do close the
connection using client.close() after search api call then I'm getting NoNodeAvailableException
Please suggest what is the correct way to call the connection object.
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e2aaf77f-cd18-4e52-98fc-c25ed03601fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.