-
1. Re: custom aggregator strategy
davsclaus Aug 18, 2010 6:18 AM (in response to dekk11)Can you post the code in the custom aggregator?
And as a workaround can you try to convert to String first, and then byte[] as 2nd?
-
2. Re: custom aggregator strategy
dekk11 Aug 18, 2010 11:03 AM (in response to davsclaus)Thanks for your help, you pointed me in the right direction. I fixed it by setting the byte[] into the out message body.
For example:
FileAggregationStrategy implements AggregationStrategy {
public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
if (oldExchange == null) {
byte[] newBytes = newExchange.getIn().getBody(byte[] newBytes = newExchange.getIn().getBody(byte[].class);
newExchange.getOut().setBody(newBytes);
return newExchange;
}
...
}
}
Why do I have to call getOut().setBody()? I thought that this was call was done by camel when it receives the newExchange back from aggregate()?
Edited by: dekk11 on Aug 18, 2010 3:02 PM
Edited by: dekk11 on Aug 18, 2010 3:03 PM