Camel
  1. Camel
  2. CAMEL-4058

OnException should overlay settings with existing error handler

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.7.2
    • Fix Version/s: 2.8.0
    • Component/s: camel-core
    • Labels:
      None

      Description

      See CAMEL-3989

      When you have an OnException it should overlay its configuration with the existing error handler (so its kinda of merge). However we mistakenly set the handled policy from the OnException always, and dont honor the setting from the error handler. So in case of DeadLetterChannel which always handle the exception, it will cause the exception to not be handled and thus rethrown in Camel.

      This problem is only apparent when using the DLC as its the only error handler that handles and moves the exchange to the DLC. The other error handler will log or the likes, but still keep the exception on the exchange to propagated back the exception to the caller.

      So we only noticed this when testing with DLC, and what Hadrian was trying to do in CAMEL-3989

        Issue Links

          Activity

          Hide
          Claus Ibsen added a comment -

          Been looking into this a bit more. I think we should keep current behavior as fix that broken issue from CAMEL-3989 where onException(MyException.class).handled(false) will cause the DLC to kick in, which was not the intention. Then we don't need this overlay stuff. It also just introduces to many variables, as you would need to test with 2x for each overlay option.

          Show
          Claus Ibsen added a comment - Been looking into this a bit more. I think we should keep current behavior as fix that broken issue from CAMEL-3989 where onException(MyException.class).handled(false) will cause the DLC to kick in, which was not the intention. Then we don't need this overlay stuff. It also just introduces to many variables, as you would need to test with 2x for each overlay option.
          Hide
          Claus Ibsen added a comment -

          This requires that we add builders in Java DSL / scala DSL so end user can turn on/off

          • useOriginalMessage
          • asyncDelayedRedelivery
          • useCollisionAvoidance
          • useExceptionalBackoff

          As they dont accept an boolean option to control it. So with overlay they will inheit parent settings, and in case you don't want that you cannot set for example - do not use orignal message. So we need for those 4:

          • useOriginalMessage(boolean)
          • asyncDelayedRedelivery(boolean)
          • useCollisionAvoidance(boolean)
          • useExceptionalBackoff(boolean)
          Show
          Claus Ibsen added a comment - This requires that we add builders in Java DSL / scala DSL so end user can turn on/off useOriginalMessage asyncDelayedRedelivery useCollisionAvoidance useExceptionalBackoff As they dont accept an boolean option to control it. So with overlay they will inheit parent settings, and in case you don't want that you cannot set for example - do not use orignal message. So we need for those 4: useOriginalMessage(boolean) asyncDelayedRedelivery(boolean) useCollisionAvoidance(boolean) useExceptionalBackoff(boolean)
          Hide
          Claus Ibsen added a comment -
          Show
          Claus Ibsen added a comment - CAMEL-4058 will fix CAMEL-3989

            People

            • Assignee:
              Claus Ibsen
              Reporter:
              Claus Ibsen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development