On Fri, Jul 13, 2012 at 5:33 PM, ben1729 <[email protected]> wrote:
> Hi all,
>
> I would like to take a message containing a list of objects, split the list
> into it's component objects, process them in parallel, aggregate the
> modified objects back into a list.
>
> I am using camel 2.8.0.
>
> From what I can see I need to use a route in the following form:
>
> from("jms:queue:from")
>     .split(Expression, AggregationStrategy) // What goes here?
>     .parallelProcessing()
>     // Processing goes here
>     .end()
>     .to("direct:end");
>
> I think I can write the aggregation strategy but I'm unsure how to split the
> list in the Expression. All the example seems to be with splitting strings.
>

You can use a method call expression (also known as bean in the DSL),
and just return a List, or Iterator etc. that contains the bodies to
split. In newer releases of Camel, there is also a method to indicate
a method call expression.

     .split(bean(MySplliterBean.class, AggregationStrategy) // What goes here?

And then just have a single public static method on the class. And you
can use the bean parameter binding for the method signature.
And then return a List / Iterator / etc.




> Ben
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Splitting-processing-and-aggregating-a-list-tp5716013.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to