You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by BojanSM <b....@levi9.com> on 2015/08/04 15:49:12 UTC

Aggregator - discard new messages

I have a situation, probably misusing aggregator component, where I need to
aggregate certain (not known) number of messages and discard the rest. Since
I don't know how many messages I have to aggregate I can not use
completionSize to finish aggregation. On the other hand, if I put some
completionTimeout, I am afraid that timeout will expire and new messages
will come for aggregation. So, I would like to discard all new messages that
satisfy correlation Expression.



--
View this message in context: http://camel.465427.n5.nabble.com/Aggregator-discard-new-messages-tp5770276.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Aggregator - discard new messages

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

They are stored in memory in a map which you can limit by size, then
its the LRU that are kept in the map.

We are adding an api to allow to clear the map manually
https://issues.apache.org/jira/browse/CAMEL-9056

On Wed, Aug 5, 2015 at 1:01 PM, BojanSM <b....@levi9.com> wrote:
> Hi,
>
> thanks Claus, closeCorrelationKeyOnCompletion actually helped me.
>
> What is my concern now, when this cached keys are cleared? For how long they
> stay cached?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Aggregator-discard-new-messages-tp5770276p5770319.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2

Re: Aggregator - discard new messages

Posted by BojanSM <b....@levi9.com>.
Hi,

thanks Claus, closeCorrelationKeyOnCompletion actually helped me.

What is my concern now, when this cached keys are cleared? For how long they
stay cached?



--
View this message in context: http://camel.465427.n5.nabble.com/Aggregator-discard-new-messages-tp5770276p5770319.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Aggregator - discard new messages

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

See the completionPredicate and the closeCorrelationKeyOnCompletion option

On Tue, Aug 4, 2015 at 3:49 PM, BojanSM <b....@levi9.com> wrote:
> I have a situation, probably misusing aggregator component, where I need to
> aggregate certain (not known) number of messages and discard the rest. Since
> I don't know how many messages I have to aggregate I can not use
> completionSize to finish aggregation. On the other hand, if I put some
> completionTimeout, I am afraid that timeout will expire and new messages
> will come for aggregation. So, I would like to discard all new messages that
> satisfy correlation Expression.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Aggregator-discard-new-messages-tp5770276.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2

Re: Aggregator - discard new messages

Posted by "mailinglist@j-b-s.de" <ma...@j-b-s.de>.
We had the same problem and aggrgator (same applies to sequencer) will not work due to a potential timeout splitting the result as you described it allready. We solved it by
a) starting the route
b) do all processing / aggregation in combination with the inflight repository to detect the end of the process (no message left in the system)
c) shutdown the route

Be careful: if you keep the route up and running you need a marker to distinguish different data sets (when does the first ser finish and the next start). We decided to simply shutdown the route after completion (empty inflight repo)

Lets see what other methods may exist.

Jens



Von meinem iPhone gesendet

> Am 04.08.2015 um 14:49 schrieb BojanSM <b....@levi9.com>:
> 
> I have a situation, probably misusing aggregator component, where I need to
> aggregate certain (not known) number of messages and discard the rest. Since
> I don't know how many messages I have to aggregate I can not use
> completionSize to finish aggregation. On the other hand, if I put some
> completionTimeout, I am afraid that timeout will expire and new messages
> will come for aggregation. So, I would like to discard all new messages that
> satisfy correlation Expression.
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Aggregator-discard-new-messages-tp5770276.html
> Sent from the Camel - Users mailing list archive at Nabble.com.