简体   繁体   中英

Where to close an Elasticsearch client connection?

Where should I close the connection to a client for Elasticsearch? I am using Spring, and I don't want to use the Elasticsearch integration because I want to learn how to do it without first. Should only one client be created for the application? Meaning that it would have singleton scope? Or should it have prototype scope and close the connection for each interaction?

您应该为每个应用程序使用一个客户端,使其成为单例并在应用程序关闭时关闭。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM