camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fordm <>
Subject Rethrowing an exception using the Dead Letter Error Handler
Date Wed, 24 Jul 2013 12:42:14 GMT

I've got a camel route that consumes from an activemq endpoint and persists
the message to a database via jpa.

If, for example, the connection to the database is lost I want to retry a
message a few times and if it still fails put it on a Dead Letter Queue.
This bit is fine:

    <errorHandler deadLetterUri="myDLQ" type="DeadLetterChannel"
        <redeliveryPolicy maximumRedeliveries="3" />

    <route errorHandlerRef="myDLErrorHandler">
        <from uri="activemq:myFromQueue" />

            <redeliveryPolicy maximumRedeliveries="2" />

        <to uri="jpa://foo" />

But as well as retrying and putting a failed message on the DLQ I want to
throw my own exception (it'll have some 'special' stuff that gets put into
the log). It's this bit I'm having problems with, I had hoped a simple
<throwException ref="mySpecialException" /> after the <handled>...</handled>
would work but it doesn't.

Any suggestions?

Many thanks

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message