camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Issue: Aggregator2 : BatchCompletion disturbed by other completions and fails to happen (when it probably should)
Date Sun, 17 Mar 2013 09:27:43 GMT
Hi

I have logged a ticket and have a fix in the works
https://issues.apache.org/jira/browse/CAMEL-6172

On Sat, Mar 9, 2013 at 9:13 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> On Fri, Mar 8, 2013 at 8:18 PM, Tim Pierce <timpiercejobs@gmail.com> 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
>
> Hi
>
> 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.
> http://camel.apache.org/contributing.html
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message