Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Not A Bug
-
3.5.0
-
None
-
Unknown
Description
"LoopDoWhile" with "delay" in the body of the loop does not see the "end" and calls steps after the "end" during each iteration.
How to reproduce:
In the test of org.apache.camel.processor.LoopDoWhileTest add "delay" into the route configuration
@Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from("direct:simple").loopDoWhile(simple("${body.length} <= 5")) .to("mock:loop") .transform(body().append("A")) .delay(1000).asyncDelayed() .end().to("mock:result"); from("direct:functional").loopDoWhile().body(String.class, b -> b.length() <= 5) .delay(1000).syncDelayed() .to("mock:loop").transform() .body(String.class, b -> b += "A").end() .to("mock:result"); } }; }
After that both tests will fall
java.lang.AssertionError: mock://result Body of message: 0. Expected: <AAAAAA> but was: <AA>
Expected :<AAAAAA>
Actual :<AA>
<Click to see difference>
The syncDelayed or asyncDelayed options does not affect the result.