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

OnCompletion with After Consumer mode does not fire if defined in routeScope

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.7.1
    • Fix Version/s: 3.7.2, 3.8.0
    • Component/s: camel-core
    • Labels:
      None
    • Environment:

      Java 11

      Apache Karaf

    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Unknown
    • Flags:
      Patch

      Description

      After upgrading from Camel 3.7.0 to 3.7.1 we noticed a regression where routes that had onCompletion defined in the route scope no longer fired.  EX

       

          from("direct:start")
              .transform(constant("a"))
              .to("mock:a")
              .to("direct:sub")
              .transform(constant("c"))
              .to("mock:c");
       
          from("direct:sub")
               .transform(constant("b"))
               .to("mock:b")
               .onCompletion()
      	     .to("mock:end")
      	 .end(); 

       

      In following the change made in CAMEL-13553 the onCompletion does not fire since the routeId of the direct:sub route where the onCompletion is scoped does not match the route id of direct:start where the onCompletion fires. 

      This works fine if I move the onCompletion defintion into direct:start.

      While on one hand this breaks our existing code it also makes me think it might just be a bad practice to define an AfterConsumerOnCompletion in a sub route.  So perhaps this should not be supported? If it should be supported I think we'll need to evaluate the routeId compare in the after route so that we do the compare in the same scope as the definition.  Open to other suggestions.  Will provide a PR with a potential approach to the supported use case. 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                bob Bob Paulin
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: