I have an Apache Camel Splitter such as the following:

...
from("{{direct.split}}")
  .split().method(splitter, "iterate").streaming()
     .stopOnException()
     .setHeader("{{header.index}}", simple("${property.CamelSplitIndex}++"))

     // Other processing

     .choice
     .when(property(Exchange.SPLIT_COMPLETE).isEqualTo(true))
        .setHeader("{{header.total}}", property(Exchange.SPLIT_SIZE))
        .to("{{bean.myService.update}}")
        .end()
     .end()
  .end()

...

where splitter in the call to "method()" is a custom iterator used to parse
the particular data I am dealing with.

Everything is fine when the XML data received has at least 1 element to
parse. My issue is when there are no elements to parse, which is legal since
there can be 0 to many elements. I want the call to "bean.myService.update"
to be called even in the cases where there are no elements to parse. In the
above code this call is not made in the case of 0 elements.

Any suggestions?




--
View this message in context: 
http://camel.465427.n5.nabble.com/How-can-I-tell-if-Apache-Camel-Splitter-didn-t-split-anything-tp5725181.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to