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

camel-core - throttle EIP doesn't work as expected when it's in a loopDoWhile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.3.0
    • 4.4.0
    • camel-core
    • None
    • Unknown

    Description

      I just upgraded my project to Apache Camel 4.3.0, and my code stop to work as expected.

      It seems there was some changes to the `throttle EIP` – it's now throttling based on the number of concurrent exchanges.

      My route uses a `loopDoWhile` to loop an exchange over and over, so in a sense, the concurrent exchange should always be zero (and the inflight exchange is actually zero).

      However, my loop will stop when it reached the max number of concurrent exchanges I set for the thottler.

      For example, in the following code, the loop will stop at 10th iteration. It seems the new changes didn't put loop DSL into consideration...

      import org.apache.camel.builder.RouteBuilder;public class Test extends RouteBuilder {    @Override
          public void configure() throws Exception {        // Write your routes here, for example:
              from("timer:java?delay=1000&repeatCount=1")
                  .loopDoWhile(constant(true)).breakOnShutdown()
                      .throttle(10)
                      .setBody()
                          .simple("Hello Camel from ${routeId}")
                      .log("${body}");
          }
      } 

      Attachments

        Issue Links

          Activity

            People

              rhuanrocha Rhuan Rocha
              pai95 Papa John
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: