camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Dillon <ja...@planet57.com>
Subject Endpoint internal exceptions and how to handle
Date Wed, 07 Dec 2011 23:11:50 GMT
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
Mime
View raw message