You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Cecil Williams <cw...@studentloan.org> on 2007/12/06 20:51:05 UTC

Multiple Error Handlers

Can you have multiple error handlers in a route builder?  We would like to
use the DeadLetterChannel and LoggingErrorHandler at the same time so that
we log a message that an exception occurred and then route the message to an
error queue.

Thanks,

Cecil Williams
-- 
View this message in context: http://www.nabble.com/Multiple-Error-Handlers-tf4958227s22882.html#a14199733
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Multiple Error Handlers

Posted by James Strachan <ja...@gmail.com>.
On 06/12/2007, Cecil Williams <cw...@studentloan.org> wrote:
>
> Can you have multiple error handlers in a route builder?

Sure!

You can have an error handler used by default for a number of routing
rules; then customize the error handler inside a route - or switch it
between routes etc.


> We would like to
> use the DeadLetterChannel and LoggingErrorHandler at the same time so that
> we log a message that an exception occurred and then route the message to an
> error queue.

You could always write your own error handler if you like; though this
requirement seems like it should be possible to use the out of the box
DeadLetterChannel. i.e. we should probably patch the DeadLetterChannel
to log errors before sending it to the dead letter queue (folks can
always disable the logging).

Another option could be to use an endpoint called "direct:deadLetter"
as your dead letter endpoint then have a routing rules as...

from("direct:deadLetter").to("log:DeadLetterChanel?level=ERROR",
"activemq:MyDeadLetterQueue");

Which would allow you to do content based routing of the error etc

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com