Claus,
I just figured it out a few minutes ago and was about to answer :)
... I confirm my correlation expression was wrong. A night of routing lead
me to the solution.
What confused me what that without a filter, it worked well : because all
bodies where the same (ie a default xml content with no data).
I did it as you suggest, and it works fine now:
.setHeader(CATEGORY_FOR_FILE,someSmartCategory)
...
.aggregate(header(EXCHANGE_CATEGORY_FOR_FILE),new AggregationStrategy() {
public Exchange
aggregate(Exchange oldExchange, Exchange newExchange) {
if
(oldExchange == null) {
return
newExchange;
}
String
oldBody = oldExchange.getIn().getBody(String.class);
String
newBody = newExchange.getIn().getBody(String.class);
oldExchange.getIn().setBody(oldBody + "+" + newBody);
return
oldExchange;
}
})
.completionSize(10) // completed only when I work
directly on "direct:files"
.convertBodyTo(byte[].class, "UTF-8")
Thanks a lot for having a look and finding the solution, and also for the
suggestions. I once had access to that book, and It helped a lot at start.
So I agree I should consider adding it to my library!
--
View this message in context:
http://camel.465427.n5.nabble.com/Aggregator-won-t-work-with-filter-tp5736645p5736686.html
Sent from the Camel - Users mailing list archive at Nabble.com.