My application intends to insert documents to Solr regularly. There are two considerations:
- Sending update request to Solr is key impact to the performance.
- Thread safe of transaction. The commit of SolrClient is not thread-safe(point this out if I'm wrong), this might cause serious problem when multiple users input document to Solr.
I found ConcurrentUpdateSolrClient
is a candidate solution that it is thread-safe, and it has a queue to buffer and flush many documents in one connection. But I am confused when I test it. My question is,
- If I set the queue size, should I still need to commit?
- If I commit, even there is only one document in the queue, it still submit a http request to Solr. Can I make it working as message queue?