camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snowbug <>
Subject Split / aggregate using custom beans
Date Tue, 01 Sep 2009 22:04:14 GMT

I am having problems to use split and aggregate with custom beans. 

I have defined two beans: mySplitter and myAggregator, with myAggregator
implements the AggregationStrategy.

What I'd like to achieve is use mySplitter to split messages, do some
processing on each splitted message, then use myAggregator to merge the
responses, then continue processing with the merged message.

I am expecting to use a route DSL like:

But the split().method() returns a Object type that does not allow me to
append further methods (note that split() and split(Expression) returns
different types). The sample on this wki page  shows:
        // here we use a POJO bean mySplitterBean to do the split of the
        .split().method("mySplitterBean", "splitBody")
which does not work in my case due to the mentioned problem.

There is no split method that takes bean method parameter and an aggregator,
it seems that I must implement the Expression interface in mySplitter class
in order to use the split(Expression, AggreationStrategy) method.

So what is the correct way of using split and aggregate with custom beans?


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message