[ 
https://issues.apache.org/jira/browse/CAMEL-7050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14041815#comment-14041815
 ] 

Willem Jiang commented on CAMEL-7050:
-------------------------------------

I just did some debugging of the code, it looks like in the 
deliverToFailureProcessor(), camel always set the shouldHandle to be true if  
deadLetterChannel. So that means the exception which is throw from the 
deadLetterChannel will be eaten by this fallback error handler.
{code}
        // always handle if dead letter channel
        final boolean shouldHandle = isDeadLetterChannel || 
shouldHandled(exchange, data);
{code}
DeadLetterChannel always set the HandledPredicate to be true, it's made the 
shouldHandled(exchange, data) always return two.

If we can override the this two parameters through the DeadLetterBuilder, we 
could let the fallback error handler to handle the exception which is thrown 
from dead letter endpoint.

> camel-jms drops messages when errorHandler throws an exception
> --------------------------------------------------------------
>
>                 Key: CAMEL-7050
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7050
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jms
>    Affects Versions: 2.11.0
>            Reporter: Øyvind Ingebrigtsen Øvergaard
>            Assignee: Willem Jiang
>         Attachments: BadErrorHandler.java, 
> JmsDeadLetterChannelHandlerExceptionTest.java
>
>
> When using camel-jms, messages are dropped when an exception is thrown in the 
> deadLetterChannel error handler.
> See the attached failing unit test.
> Verified against 2.11 and HEAD



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to