I swallow millions of records in elasticsearch, and also retrieve records from elasticsearch. I am actively using elasticsearch client interface. I create only one client on each JVM. Using this client, swallowing data in elasticsearch, and also exposing data from elasticsearch using them. The extracted data is written to files and analyzed, written back to the files and embedded data back into elasticsearch using.
1) Is this the best way to create only one java client on one JVM and keep it alive?
2) or create a client when necessary, and swallow / extract data, close it.
3) Or create a client pool and reuse it (e.g. pooling)
What is the best way to do this?
source
share