Good practice to create TransportClient

(Nemo) #1

Hi All,
Currently, in my project, I am creating new TransportClient for each query request and have some fixed number of clients to insert records into ES. Query request can come at any time but insertion happens once in 10min(may go upto ~150000 documents ). I was wondering if I can handle all this using single singleton client. If so do I need to modify the client settings such as thread pool size? Will single client handle all this operation? How to recover singleton transport client when there is NoNodeAvailable Exception? Can some one please guide me through best practices to create transport client?


(David Pilato) #2

Yes please. One single client per JVM. It's threadsafe.

(Nemo) #3

Thank you very much for your quick response.
What if this client fails because of NoNodeAvailable Exception. How to recover the client?

(system) #4