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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.7.1
    • 3.7.2, 3.8.0
    • camel-core
    • None
    • Java 11

      Apache Karaf

    • Patch Available
    • Unknown
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: