You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Julien D <my...@hotmail.com> on 2010/02/11 18:11:28 UTC

Aggregator and completionPredicate

Hi everybody,

I have a question about aggregation with the completionPredicate. What does
happen if somehow the predicate is never true ?

For example if I have something like that :

//Some camel code...
.aggregate().completionPredicate(header(Exchange.AGGREGATED_SIZE).isEqualTo(5)

and the AGGREGATED_SIZE never reached 5.

Does the thread hang forever ?

-- 
View this message in context: http://old.nabble.com/Aggregator-and-completionPredicate-tp27550871p27550871.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Aggregator and completionPredicate

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Feb 11, 2010 at 8:33 PM, Julien D <my...@hotmail.com> wrote:
>
> I have to look into the code to confirm this but I think that if you set the
> completionPredicate and you do not set the batchTimeout, the batchTimeout by
> default will not be active.
>

Sorry the current behavior is unfortunately that timeout is always active.

So its triggered when either the timeout or the completion predicate
signals first.
You can however set a high timeout value to give the completion
predicate the best chance to signal first.


We are planning to overhaul the aggregator in 2.3 timeframe
http://camel.apache.org/camel-21-overhaul-of-aggregator-eip.html

There are tickets in JIRA to track this.

>
> lekkie wrote:
>>
>> I think there is a batchtimeout which by default is 1sec.
>>
>> So, whichever comes first 'd kick in.
>>
>>
>>
>> Julien D wrote:
>>>
>>> Hi everybody,
>>>
>>> I have a question about aggregation with the completionPredicate. What
>>> does happen if somehow the predicate is never true ?
>>>
>>> For example if I have something like that :
>>>
>>> //Some camel code...
>>> .aggregate().completionPredicate(header(Exchange.AGGREGATED_SIZE).isEqualTo(5)
>>>
>>> and the AGGREGATED_SIZE never reached 5.
>>>
>>> Does the thread hang forever ?
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Aggregator-and-completionPredicate-tp27550871p27552240.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Aggregator and completionPredicate

Posted by Julien D <my...@hotmail.com>.
I have to look into the code to confirm this but I think that if you set the
completionPredicate and you do not set the batchTimeout, the batchTimeout by
default will not be active.


lekkie wrote:
> 
> I think there is a batchtimeout which by default is 1sec.
> 
> So, whichever comes first 'd kick in.
> 
> 
> 
> Julien D wrote:
>> 
>> Hi everybody,
>> 
>> I have a question about aggregation with the completionPredicate. What
>> does happen if somehow the predicate is never true ?
>> 
>> For example if I have something like that :
>> 
>> //Some camel code...
>> .aggregate().completionPredicate(header(Exchange.AGGREGATED_SIZE).isEqualTo(5)
>> 
>> and the AGGREGATED_SIZE never reached 5.
>> 
>> Does the thread hang forever ?
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Aggregator-and-completionPredicate-tp27550871p27552240.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Aggregator and completionPredicate

Posted by lekkie <le...@gmail.com>.
I think there is a batchtimeout which by default is 1sec.

So, whichever comes first 'd kick in.



Julien D wrote:
> 
> Hi everybody,
> 
> I have a question about aggregation with the completionPredicate. What
> does happen if somehow the predicate is never true ?
> 
> For example if I have something like that :
> 
> //Some camel code...
> .aggregate().completionPredicate(header(Exchange.AGGREGATED_SIZE).isEqualTo(5)
> 
> and the AGGREGATED_SIZE never reached 5.
> 
> Does the thread hang forever ?
> 
> 

-- 
View this message in context: http://old.nabble.com/Aggregator-and-completionPredicate-tp27550871p27551409.html
Sent from the Camel - Users mailing list archive at Nabble.com.