Hi,
The issue is not yet closed because the documentation is not done, so
look for that.
In brief this feature is mostly using for testing/debugging (as the
jira states). So the number of iterations is passed either as an int
value as an argument to loop(int), or as an expression. The
expression *must* evaluate to an *int*, not a bool, which determines
the iteration count (e.g. you could send the iteration count in a
header). The test case should be self explanatory for now.
Keep in mind that the preconditions for the loop remain unchanged,
that is the exchange for iteration n, would be the same as for
iteration 0, but through the course of an iteration one may decide to
do different things. I think it would be useful to add one or two
properties on the exchange with the iteration index/count.
I hope this helps and thanks for the feedback,
Hadrian
On Sep 24, 2008, at 12:49 PM, Raul Kripalani (JIRA) wrote:
[ https://issues.apache.org/activemq/browse/CAMEL-325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45967
#action_45967 ]
Raul Kripalani commented on CAMEL-325:
--------------------------------------
A few questions about the following code block:
from("file://foo").
loop().xpath("/something = 'abc').
to("blah");
- What EXACTLY would this do? Would it keep on sending the message
to endpoint "blah" WHILE the XPath evaluates to true?
- What exactly is fed back to the xpath condition to re-evaluate the
looping condition after every iteration? I mean, when would this
become false?
- I'm not sure if the semantics of this construct are clear. I mean,
is the looping done UNTIL the XPath evaluates to true? Or does it
loop WHILE the XPath evaluates to true?
support a loop operation in the routing DSL
-------------------------------------------
Key: CAMEL-325
URL: https://issues.apache.org/activemq/browse/CAMEL-325
Project: Apache Camel
Issue Type: New Feature
Components: camel-core
Reporter: James Strachan
Assignee: Hadrian Zbarcea
Fix For: 1.5.0
It'd be nice to do something like
{code}
from("file://foo").
loop(100).
to("blah");
{code}
Or use some kinda expression
{code}
from("file://foo").
loop().xpath("/something = 'abc').
to("blah");
{code}
To essentially add a loop inside a route. Testing is the main use
case for this really. e.g. take a few production messages and
generate zillions of test case messages
{code}
from("file://foo").
loop(100).
bean(MyRandomizerTransform.class).
to("blah");
{code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.