Thanks again

1 final question on this. If an exception occurs in the run method of the
consumer, I want the endpoint, producer and consumer to be re-started.

I was thinking of handling this as follows:

class CustomConsumer extends DefaultConsumer implements Runnable{
......

public void run(){

    try{

    } catch (Exception exc){
       getCamelContext().stopRoute("routeName");  
       getCamelContext().startRoute("routeName");  
    }

.....
}

However, from the documentation it says I need to call
getCamelContext().getInflightRepository().remove(Exchange) before calling
getCamext().stopRoute("routeName"). Unfortunately, in the consumer I do not
have access to the Exchange object, i.e. I can only create a new Exchange
object. Any suggestions?

My custom component is a singleton and its referenced in different routes

Thanks
Joe

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

Reply via email to