camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Thomas <>
Subject Logging Error in Message or Exchange in DB (Not getting the exception in Processor)
Date Mon, 10 Aug 2015 11:19:31 GMT

      I tried the Below error Handling using DeadLetterChannel , but
currently I am not getting the exception or error in my processor . I want
to log in DB the message along with the reason it failed , for example JDBC
exception, Null pointer exception , data Validation exception  in some
method etc.

   <bean id="myErrorHandler"
            <property name="deadLetterUri" value="direct:myErrorRoute"/>
            <property name="redeliveryPolicy"

        <bean id="myRedeliveryPolicyConfig"
            <property name="maximumRedeliveries" value="1"/>
            <property name="redeliveryDelay" value="5000"/>
            <property name="allowRedeliveryWhileStopping" value="false"/>

<!--  Error Handler Generic one -->
    <route customId="false" id="myErrorRoute" xmlns="">
        <from uri="direct:myErrorRoute"/>
        <process  ref="CustomErrorProcessor"/>
        <to uri="mock:end"/>

 In the Error Processor is called proper on Exception, But I dont get an
Exception from  exchange object nor Fault from the message object.

i tried the below flags too. exchange.isFailed()  and message.isFault()
but returned false.  While in the Logs I can see the exception printed

2015-08-10 12:19:19,218 [read #8 - Split] DEBUG
DeadLetterChannel              - Failed delivery for (MessageId:
ID-DEACR002901-62175-1439201946611-0-1 on ExchangeId:
ID-DEACR002901-62175-1439201946611-0-10). On delivery attempt: 0 caught:

Failed delivery for (MessageId: ID-DEACR002901-62175-1439201946611-0-1 on
ExchangeId: ID-DEACR002901-62175-1439201946611-0-14). On delivery attempt:
1 caught: java.lang.NullPointerException

How do I get the Origin of the exception in my errorprocessor.

Felix T

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message