Olaf
2013-11-05 11:57:41 UTC
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!
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!