I just wanted to use an out-of-the-box strategy for a quick example. I
generally create my own strategy and use the body instead. I created the
JIRA issue because I think this should be a standard strategy (if not the
default mode as you suggested).
Here is a simple strategy to build up a List in the aggregated exchange's IN
body (submitted for inclusion in the JIRA)...
Is this what you were looking for?
public class AggregateAsListStrategy implements AggregationStrategy {
@SuppressWarnings("unchecked")
public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
List list;
Exchange answer = oldExchange;
if (oldExchange == null) {
answer = new DefaultExchange(newExchange);
list = new ArrayList();
answer.getIn().setBody(list);
} else {
list = (List) oldExchange.getIn().getBody();
}
if (newExchange != null) {
list.add(newExchange.getIn().getBody());
}
return answer;
}
}
pminearo wrote:
>
> Out of curiousity, why put this in as a Property instead of replacing the
> Message Body?
>
-----
Ben O'Day
IT Consultant -http://benoday.blogspot.com
--
View this message in context:
http://camel.465427.n5.nabble.com/Default-Behavior-for-aggregate-tp4296790p4299300.html
Sent from the Camel - Users mailing list archive at Nabble.com.