I think that creating it when you run it and closing it will be just fine.  As 
Shawn said, it’ll be “well under a second” ;-)./

> On May 30, 2023, at 2:01 PM, Shawn Heisey <elyog...@elyograg.org> wrote:
> 
> 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

_______________________
Eric Pugh | Founder & CEO | OpenSource Connections, LLC | 434.466.1467 | 
http://www.opensourceconnections.com <http://www.opensourceconnections.com/> | 
My Free/Busy <http://tinyurl.com/eric-cal>  
Co-Author: Apache Solr Enterprise Search Server, 3rd Ed 
<https://www.packtpub.com/big-data-and-business-intelligence/apache-solr-enterprise-search-server-third-edition-raw>
    
This e-mail and all contents, including attachments, is considered to be 
Company Confidential unless explicitly stated otherwise, regardless of whether 
attachments are marked as such.

Reply via email to