camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Java DSL: do I have to have a child for a split()?
Date Sat, 12 Oct 2013 07:05:23 GMT

Yes a child output is expected.

Maybe instead of using splitter use message translator, and return
what your want asap, instead of splitting.

On Fri, Oct 11, 2013 at 9:58 PM, Keith Freeman <> wrote:
> My route is built in parts from different spots in my code, and at one point
> I do a split:
>     choice().when(...).bean(...).split().method(splitBean,
> "splitMethod").endChoice().otherwise().bean(...);
> This results in a "IllegalArgumentException: Definition has no children on
> Split...".
> But at this point in the code I don't know what's going to be added to the
> route, I just want the results of the split() to be forwarded down the
> route.  I currently accomplish this by sticking a no-op processor into the
> route:
>     ...split().method(...).process(new Processor() { public void
> process(Exchange e) { /* no-op */ }}).endChoice()...
> Which works fine, but do I really have to do this (it seems kind of ugly and
> inefficient)?  Is there something better as a Camel coding idiom that's
> maybe more efficient?

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:

View raw message