Hi Yeah it looks like a bug. I logged a ticket https://issues.apache.org/jira/browse/CAMEL-5720
On Fri, Oct 19, 2012 at 4:25 PM, breilhes <[email protected]> wrote: > 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. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
