Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9555

Setting deadLetterHandleNewException to false breaks DeadLetterChannel default exception handling

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.15.6, 2.16.3, 2.17.0
    • camel-core
    • None
    • Unknown

    Description

      By default, the DeadLetterChannel handles every exception, including any exception thrown by the dead letter itself. This can be changed by setting the option deadLetterHandleNewException to false. Unfortunately, setting it to false also disable the handling in case of a normal exception, which is not at all what the name suggests.

      To make the point clear, here is the little scenario I am trying to set up, and why this option is really important in that case.

      Scenario

      I have a camel route consuming persistent messages from a JMS (activemq) endpoint. I have set CLIENT_ACKNOWLEDGE on the component to prevent consuming the messages until they have been successfully processed.

      So I want to configure my error handler as a DeadLetterChannel with the following behavior:

      1. in case of an exception during processing, send the message to a DLQ
      2. if the DLQ itself fails (preventing the message to be safely stored), do not handle it and let the exception being propagated back to the JMS consumer, such that ActiveMQ won't remove it from its queue.

      From my understanding, this is what the option deadLetterHandleNewException=false should provide. But when testing it, setting it to false actually breaks the default handling of the dead letter channel as well, and no exception at all are handled, even when successfully sent to the DLQ...

      I checked DeadLetterHandleNewExceptionTest from the camel test cases, but it does not cover the scenario I described (it only checks the behavior when the DLQ fails, not when it succeeds).

      Basically, in the current release, I can either have:

      • the DLC handle all exceptions (default)
      • the DLC handle no exception at all (with deadLetterHandleNewException=false)

      However, the intended behavior with deadLetterHandleNewException=false should have the DLC handle any exception thrown during normal routing, while not handling any exception thrown during the DLQ processing itself.

      Attachments

        1. DeadLetterChannelTest.java
          3 kB
          Laurent Chiarello

        Activity

          People

            davsclaus Claus Ibsen
            lchdev Laurent Chiarello
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: