On Mon, Apr 30, 2012 at 5:03 PM, Hoang-Vu PHUNG <hvu.ph...@gmail.com> wrote:
> ---------- Forwarded message ----------
> From: Hoang-Vu PHUNG <hvu.ph...@gmail.com>
> Date: 2012/4/30
> Subject: Question regarding loop in camel
> To: users-h...@camel.apache.org
>
>
> Hi all,
>
> So far the loop construction in camel has a fixed number of iterations.
> Is it possible some how to :
>
> 1. dynamically change the count of interations

No

> 2. or exit the loop earlier

Yes using stop. See the StopProcessor source code

> 3. or better use a Predicate that is re-evaluated to decide to continue to
> iterate or not ?
>

There is a JIRA to make the loop like a while loop so we can use a
predicate to know if we should continue looping or not.
So someday in a future Camel release you can do it.

> My project is to use camel to simulate a process workflow. I prefer camel
> because of its simplicity of usage.
> My only problem is how to simulate a while loop. I can do something like
> fixing a high number of iterations and then use a choice condition to
> decide to execute the process but we waste the resources unnecessarily.
>
> Thanks for your answer.
> Regards,
> Hoang-Vu



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to