Hi,
I'm a little confused about the split EIP pattern combined with aggregation
strategy. In the example (see http://camel.apache.org/splitter.html - Split
aggregate request/reply sample), the out exchange is used to retrieved the
body content and also to set it because the pattern is of type InOut.
I have created an aggregator but in my case, I must use the content of the
In to retrieve my body
List requestMessages = new ArrayList();
if (oldExchange == null) {
requestMessages.add(newExchange.getIn().getBody(RequestMessage.class));
newExchange.getOut().setBody(requestMessages);
return newExchange;
} else {
// Get old messages
requestMessages = oldExchange.getIn().getBody(List.class);
// Get new and add it to the list
requestMessages.add(newExchange.getOut().getBody(RequestMessage.class));
// Add to the exchange
oldExchange.getOut().setBody(requestMessages);
return oldExchange;
}
Questions :
- Is the split EIP an InOut pattern ?
- When I develop the aggregator like this, the headers of my messages have
disappeared when the endpoint called after the end of the split receives the
List of Objects. How can I avoid this ?
Regards,
Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer
*****************************
blog : http://cmoulliard.blogspot.com