I'm afraid you have to catch the exception in your consumer. Then you may notify the out side manager which can restart the route for you.

I don't think current camel error handler can deal with this kind situation.

On Wed Dec 14 02:11:55 2011, Jason Dillon wrote:
Is there a better place to ask this question?

--jason


On Dec 7, 2011, at 3:11 PM, Jason Dillon wrote:

I'm wondering what (if any) is the camel way to cope w/and handle exceptions 
which are internal to and endpoint (not for those which occur while processing 
exchanges with an endpoint).

For example if I setup a JMS component (simple container, w/retry connect 
enabled), when the route is started and the remote is up, then the route starts 
and everything looks happy.  But sometime after that the remote connection is 
lost and its not a simple brief/transient network failure (lets say the machine 
exploded, or maybe nicer that the network cable was unplugged).  The JMS 
endpoint using the Simple container will attempt to recovery, quickly fail, and 
then end up in limbo.

It doesn't look like this state alters the state of the route and no exchanges 
w/error details are exposed to process.  I was able to hook up exception 
listeners and error handlers onto the JMS component configuration and they are 
called.

My question here is really how to generally cope with endpoint failures in "the 
camel way".

In this case, I'm using a route from a JMS broker to consuming messages only, 
so I'd really never know by use of an errorHandler() or onException() that 
anything bad happened at all.  I'm guessing that since the route did start that 
the dsl configured error bits might have been invoked if an exchange was 
attempted to send a message though this failed JMS endpoint?

For this specific use of the (stock) JMS component I'm starting the route separate from adding it, and 
I think in this error case I really want to stop the route for it, then retry starting it again and/or 
potentially selecting an alternate JMS endpoint configuration for the component.  Is the best way ASIS 
to hook up an "exceptionListener"&| "errorHander" to the component when 
configured and the basically initiate restarting/configuring the route from there?

Is there a better way to cope with this type of failure in Camel?

Thanks,

--jason





--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
        http://jnn.javaeye.com (Chinese)
Twitter: willemjiang Weibo: willemjiang

Reply via email to