Ebe, what does your bean return?  If its just a String, then just use the
completionSize() like this...

from("direct:start")
.to("bean:myBean")
.aggregate(constant(true), new MyAggregationStrategy()).completionSize(2000)
.to("file:myFile");

If the bean returns a List of Strings, then you can split them, then
aggregate them based on your strategy

from("direct:start")
.to("bean:myBean")  //returns List<String>
.split(body())  //splits into String
.aggregate(constant(true), new MyAggregationStrategy()).completionSize(2000)   
.to("file:myFile");

see this page, http://camel.apache.org/aggregator2.html for more details...


ebinsingh wrote:
> 
> Hi All,
> 
> Appreciate your help.
> 
> I have a bean that returns a String or a StringBuilder. I want to
> aggregate the first 2000 String's returned by this method into a single
> file.
> 
> I am having trouble with finding the right correlationExpression to
> aggregate them.
> 
> Please can you help me fix this.
> 
> Thanks & regards,
> Ebe
> 


-----
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/correlationExpression-while-Aggregating-tp4975191p4975219.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to