I am trying something very simple with Camel 2.1.0. I want to add a Processor
to my route that receives batches of 10 messages. With those 10 messages I
create a new message that is what I want to be sent. I tried to use an
aggregator, with a batchSize of 10, but it doesn't work fine. This is the
route definition inside my RouteBuilder.configure() method:

from("myEndpoint1...")
                .aggregate().constant(true).batchSize(10).groupExchanges()
                .process(new Processor() {
                    public void process(Exchange e) {

                        List<Exchange> list =
e.getProperty(Exchange.GROUPED_EXCHANGE, List.class);
                        System.out.println("I am going to process
"+list.size()+ "messages");

                        Object result =
CreateSingleOutputFromCollection(list);

                        e.getIn().setBody(result);
                    }
                })
.to("myEndpoint2...");

The problem is that the list always contains one single element only. What
am I doing wrong?
-- 
View this message in context: 
http://old.nabble.com/In-a-route%2C-how-can-I-process-a-batch-of-messages-to-send-a-single-output--tp26959490p26959490.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to