camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cristisor <>
Subject Re: count of processed messages when using aggregation
Date Wed, 13 Nov 2013 18:36:30 GMT
You could set a count header on each exchange which leaves
".bean("myProcessor", "doWork")" and in the end log the number of the last
exchange or have the ".bean("myProcessor", "doWork")" increase an internal
counter and when you receive CamelSplitComplete you go into the myProcessor
bean again and log the counter value, then you reset it so that a new csv
can start from 0.
Something like this:
                .bean("myProcessor", "doWork") // inside the doWork method
you increase the counter
                .aggregate(constant("id"), new
                .parallelProcessing() // why would you need this one?
                        .bean("myProcessor", "logCounterAndResetCounter")
                         .log("lfile not completed yet");

If sending to the remote server is time consuming and you need performance
then you could do something like this to increase the performance:
                .aggregate(constant("id"), new


This will put the aggregated exchanges on another thread which will take
care of the sending and logging while the initial thread continues to
process csv lines without having to wait for the remote machine to
acknowledge the aggregated exchanges.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message