You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by deniz <de...@gmail.com> on 2018/12/27 08:06:13 UTC

ConcurrentUpdateSolrClient - notify on success/failure?

I am trying to figure out if i can log anything or fire some events for other
listeners (like a jee event and so on) once ConcurrentUpdateSolrClient sends
the updates to the Solr (i.e internal queue is emptied and the request is
made with the all of the data to Solr itself) from java code... I am trying
to find a way to add some logic based on the "flushing" status of
ConcurrentUpdateSolrClient basically... 

After digging a bit, i found some methods which might be useful, but couldnt
find any explanation regarding those...

blockUntilFinished() -> seems this might be useful, but couldnt find any
example cases.
handleError(Throwable ex) -> only logs the error
onSuccess(HttpResponse resp) -> empty method body, needs overwriting

there is also shutdownNow(), but it doesnt seem to be useful for the
functionality i am looking for... 

are there any other ways to listen the flushing? and could anyone explain
some details about blockUntilFinished() please? in what cases it can be
useful? 







-----
Zeki ama calismiyor... Calissa yapar...
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: ConcurrentUpdateSolrClient - notify on success/failure?

Posted by Mikhail Khludnev <mk...@apache.org>.
Needless to say about handleError() and onSuccess() callbacks.

On Wed, Jan 2, 2019 at 6:14 AM deniz <de...@gmail.com> wrote:

> thanks a lot for the explanation :)
>
>
>
> -----
> Zeki ama calismiyor... Calissa yapar...
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>


-- 
Sincerely yours
Mikhail Khludnev

Re: ConcurrentUpdateSolrClient - notify on success/failure?

Posted by deniz <de...@gmail.com>.
thanks a lot for the explanation :) 



-----
Zeki ama calismiyor... Calissa yapar...
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: ConcurrentUpdateSolrClient - notify on success/failure?

Posted by Shawn Heisey <ap...@elyograg.org>.
On 12/27/2018 1:06 AM, deniz wrote:
> I am trying to figure out if i can log anything or fire some events for other
> listeners (like a jee event and so on) once ConcurrentUpdateSolrClient sends
> the updates to the Solr (i.e internal queue is emptied and the request is
> made with the all of the data to Solr itself) from java code... I am trying
> to find a way to add some logic based on the "flushing" status of
> ConcurrentUpdateSolrClient basically...

CUSC always returns from add requests immediately and indicates success, 
before the information is even sent to Solr. If there is a problem 
during indexing, it will be logged, but the client will not send any 
kind of notification to your program.

That client is designed to take care of indexing operations in the 
background, disconnected from the program that initiated the indexing.  
It isn't designed for error or success handling. It would take a 
redesign of the client to add that capability. Such a redesign is not an 
easy task.

Thanks,
Shawn