Hi,
I have a problem when I used completionSize in an aggregator.
For example, my route is :
<camel:route id="Aggregating" errorHandlerRef="errorHandler">
<camel:from uri="direct:aggregatePerSatellite"/>
<camel:aggregate id="aggregatorBySatellite"
strategyRef="aggregateBySatelliteStrategy"
aggregationRepositoryRef="satelliteAggregationRepository"
completionTimeout="60000"
completionSize="50">
<camel:correlationExpression>
<camel:simple>${header[Identifier]}</camel:simple>
</camel:correlationExpression>
<camel:completionSize>
<camel:simple>header.DpcTCPCompletionSize</camel:simple>
</camel:completionSize>
<camel:to uri="direct:processingFile"/>
</camel:aggregate>
</camel:route>
If in the exchange header, I have the value 1000 for key
DpcTCPCompletionSize, the aggregator still use the constant value 50 as
completionSize.
Is is due to a bug in the method isCompleted(String key, Exchange exchange)
of AggregateProcessor. If completionSizeExpression is defined, not null and
with a value > 0. If the size of aggregation is less than
completionSizeExpression , it allready tests the end of aggregation with
completionSize.
Here is the code :
if (getCompletionSizeExpression() != null) {
Integer value = getCompletionSizeExpression().evaluate(exchange,
Integer.class);
if (value != null && value > 0) {
int size = exchange.getProperty(Exchange.AGGREGATED_SIZE, 1,
Integer.class);
if (size >= value) {
return "size";
}
}
}
if (getCompletionSize() > 0) {
int size = exchange.getProperty(Exchange.AGGREGATED_SIZE, 1,
Integer.class);
if (size >= getCompletionSize()) {
return "size";
}
}
Regards
--
View this message in context:
http://camel.465427.n5.nabble.com/Bug-with-completionSize-on-AggregatorProcessor-tp5721307.html
Sent from the Camel - Users mailing list archive at Nabble.com.