On 5/30/23 11:13, mtn search wrote:
My initial thought is to create a client as needed rather than to reuse due to the gap in time between usage. Feedback?
My general advice would be to create a client when the program starts and close it when the program ends. The clients are designed for long term thread-safe usage.
Recent SolrJ clients use a Jetty HttpClient, which runs threads of its own. But those threads should be idle if there are no requests underway.
I do not know how long it takes to spin up a new client. Whatever the timespan is, you may or may not consider it to be trivial. Most likely it happens in well under a second.
Thanks, Shawn
