camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Issue: Aggregator2 : BatchCompletion disturbed by other completions and fails to happen (when it probably should)
Date Sat, 09 Mar 2013 08:13:14 GMT
On Fri, Mar 8, 2013 at 8:18 PM, Tim Pierce <> wrote:
> There is a bug - at least I assume it not desired functionality where if
> you have more than one completion of which .completionFromBatchConsumer()
> is one of them
> if Exchange property CamelBatchSize is 2505 and .completionSize( ) is 1000
> you would like batches of
> 1000 - compeltionSize
> 1000 - completionSize
> 505 - batchCompletion
> but actually this will never happen, this is because the batch-counter
> AtomicInteger does not get updated if a different completion occurs, so in
> the above example
> the counter will finish at 2503 and never reach 2505, because each time the
> completionSize occured the method quit
> it could be easily remedied by moving the onCompletionBatch section of the
> method
> AggregateProcessor: isCompleted(String key, Exchange exchange)
> to the top of the method instead of the bottom.
> batchConsumerCounter is the thing that doesnt get updated if another
> compeltion occurs
> I'd be happy to code this and submit it, but not sure if that sioluition
> fits with your existing ideas about the module. It looks fairly obvivously
> like a bug to me... if you guys are happy with that.
> sorry not written a test-case


The completionFromBatchConsumer option is intended to be used as the
only completion if we route from a batch consumer, and want to
aggregate and complete that batch. Combining that completion with the
other completions was not intended originally.

But I can see your use-case.

And if we can support that as well, then that would be fine.

Fell free to log a JIRA and work on a patch. And adding an unit test
to cover this use-case would be great.

Claus Ibsen
Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message