You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Davis Ford <df...@axeda.com> on 2011/09/26 19:53:22 UTC

how does camel handle runtime exceptions?

Hi, just curious how would camel handle a runtime exception in this routing example:

from("jms:someQueue").beanRef("someBean", "doSomething");

If bean#doSomething() throws a RuntimeException?  Is the exception just logged and swallowed?  I'm mainly just interested in understanding if it will affect future processing of messages that show up on the queue.

Re: how does camel handle runtime exceptions?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can read about error handling here
http://camel.apache.org/error-handling-in-camel.html

The exception will by default be propagated back to the consumer.
So in this case the JMS consumer. And it will by default log the exception.

You can enable JMS transaction and thus have the JMS consumer to
rollback the TX.
And have the message redelivered.

For that you need TX
http://camel.apache.org/transactional-client.html



On Mon, Sep 26, 2011 at 7:53 PM, Davis Ford <df...@axeda.com> wrote:
> Hi, just curious how would camel handle a runtime exception in this routing example:
>
> from("jms:someQueue").beanRef("someBean", "doSomething");
>
> If bean#doSomething() throws a RuntimeException?  Is the exception just logged and swallowed?  I'm mainly just interested in understanding if it will affect future processing of messages that show up on the queue.
>



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