I am trying to set up a loop in camel that will run until a successful state is 
reached, or no more than 5 tries if it is not.

I have it working with the following:

. setProperty(“loop”, constant(1))
.loopDoWhile(simple("${property.loop} != 0 && ${property.CamelLoopIndex} != 5)
//actual work
.when( successfully finished). setProperty(“loop”, constant(0))
.end

This does work, but then I need to decide after the loop is finished, did it 
successfully do what it needed to do or did it error out.

Which adds another choice, etc after the loop to conditionalize my next step, 
depending on why the loop exited.

While this does work, this seems very kludgy and adds a lot of conditionals to 
the route.  Is there a more “camelish” way to accomplish this run this loop 
until a condition is met, or X number of times?






--
Sean Peck
UPMC Enterprises
Lead Software Engineer
pec...@upmc.edu<mailto:pec...@upmc.edu>
412 647 5624
“The answer is a question that I never will find out.”

Reply via email to