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

loopDoWhile will loop forever if using ahc component in the loop.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.17.0
    • Fix Version/s: 2.17.1, 2.18.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      I have tested several times. The loop condition will not be checked if ahc component is in the loop.
      from("quartz2://jf-log/trigger3?trigger.repeatInterval=2&trigger.repeatCount=0")
      .loopDoWhile(body().isNotEqualTo("done"))
      .setHeader(Exchange.HTTP_METHOD, constant("GET"))
      .to("ahc:https://www.baidu.com/")
      .choice()
      .when(exchangeProperty("CamelLoopIndex").isEqualTo(3))
      .setBody(constant("done"))
      .endChoice()
      .end()
      .end()
      .to("mock:result");
      The loop will be infinite, the workarround is to use http component instead of ahc.

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              sanigo@gmail.com Sanigo
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: