camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olaf <omgolafg...@gmail.com>
Subject count of processed messages when using aggregation
Date Tue, 05 Nov 2013 11:57:41 GMT
Hello,

is there an easy way to count and sum all processed lines by an aggregator?
Suppose, my file has 9999 lines, the route split it into 100 lines chunks
and send them to a remote system. The goal is, to gather statistics of all
sent lines. In the example below, .log() would always print the aggregation
size (100 or less) and not the number of overall processed messages, which
should be 9999

    @Override
    public void configure() throws Exception {
            from("file:input.csv")
               
.unmarshal().csv().split(body()).streaming().parallelProcessing()
                .bean("myProcessor", "doWork")
                .aggregate(constant("id"), new
Aggregator()).completionSize(100).completionTimeout(1000)
                .parallelProcessing()
                .to("remote")
                .log("Sent ${header.RecordsCounter} records to remote");
    }

Thanks in advance!




--
View this message in context: http://camel.465427.n5.nabble.com/count-of-processed-messages-when-using-aggregation-tp5742649.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message