Hi Gert,
Please find below the route and aggregator;

 from(ACTIVEMQ_INBOUND)
                .aggregate(header(Exchange.FILE_NAME_ONLY), new
MyAggregator())
                .completionTimeout(getAggregationTimeout())
                .beanRef("myprocessor","process")
                .to(ACTIVEMQ_OUTBOUND)
                .end();

Aggregator:
@Override
        public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
                ArrayList<MyObject> objList =null; 
                MyObject objNew = 
(MyObject)newExchange.getIn().getBody(MyObject.class);
                
                
                if(oldExchange == null)
                    {
            objList = new ArrayList<MyObject>(); 
            objList.add(objNew) ; 
            newExchange.getIn().setBody(objList); 
           
            return newExchange;
            
            }
                else{
                        objList=oldExchange.getIn().getBody(ArrayList.class);
                        objList.add(objNew);
                        
                        return oldExchange;
                    }






--
View this message in context: 
http://servicemix.396122.n5.nabble.com/AggregatStrategy-issue-Camel-Fuse-ESB-tp5717450p5717455.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to