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

Unexpected behavior in fault handling with doTry/doCatch

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.15.0
    • 2.15.1, 2.16.0
    • camel-core
    • None
    • Unknown

    Description

      There seems to be a peculiarity with fault processing when a route consists of a single TryProcessor and the MEP for an exchange is InOut. The TryProcessor will iterate over any number of processors defined inside of it and during each iteration it sets the out msg to the in msg and clears the out msg reference. The end result of this is that when the route completes, the out reference is cleared and Exchange.isFailed() will return false (it checks the out message for fault status). Here’s where things get interesting, if I add a single processor after the doTry block, some logic in Pipeline kicks in that copies the in message to the out message for InOut MEPs before ending the route.

      I have included a unit test which demonstrates the expected behavior and current (unexpected) behavior. The expected behavior test fails and the unexpected behavior test passes. Additional details can be found as comments in the unit test and the camel configuration containing the routes under test.

      Attachments

        1. trywithfault2.zip
          7 kB
          Keith Babo

        Activity

          People

            davsclaus Claus Ibsen
            kcbabo Keith Babo
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: