Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Loop

The Loop allows to process the a message a number of times and possibly process them in a different way. Useful mostly for testing.

...

.

For each iteration two properties are set on the Exchange that could be used by processors down the pipeline to process the Message in different ways.

Property

Description

CamelIterationCount

Total number of iterations to be run

CamelIterationIndex

Index of the current iteration (0 based)

that could be used by processors down the pipeline to process the Message in different ways.

Examples

The following example shows how to take a request from the direct:x endpoint , then send the message repetitively to mock:result. The number of times the message is sent is either passed as an argument to loop(), or determined at runtime by evaluating an expression. The expression must evaluate to an int, otherwise a RuntimeCamelException is thrown.

For each iteration two properties are set on the Exchange that could be used by processors down the pipeline to process the Message in different ways.

CamelIterationCount

Total number of iterations to be run

CamelIterationIndex

Index of the current iteration (0 based)

that could be used by processors down the pipeline to process the Message in different ways.

Using the Fluent Builders

...