On Fri, Jun 15, 2012 at 6:28 PM, gilboy <josephoto...@gmail.com> wrote:

> Thanks for the response.
>
> I was just thinking about this a little further. If an exception occurs in
> my consumer, I really just need to restart the consumer not the whole
> route.
>
> If I take this approach, i.e.
>
> class CustomConsumer extends DefaultConsumer implements Runnable{
> ......
>
> public void run(){
>
>   try{
>
>   } catch (Exception exc){
>       doStop();
>      doStart();
>   }
>
> .....
> }
>
> By only restarting the consumer I will not need to worry about inflight
> exchanges, right?
>
>
No


> Is it bad practise to restart a consumer in isolation?
>
>
Depends on the consumer itself, as essentially if there is an inflight
exchange in progress that originated from this consumer, then when that
inflight message is complete it returns control back to the consumer (eg
after the process method). And it depends then what happens next. Eg if you
need to do some after work, eg from a mail consumer, you may need to close
a mail session etc.
And if you have restarted the consumer manually in-between, then some side
effects may happen.

It all depends on what you consumer does, and if it can support this or not.



> Thanks
> Joe
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Component-Consumer-Threading-Question-tp5714233p5714559.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to