You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by bluewolfca <bl...@gmail.com> on 2014/05/20 21:02:24 UTC

Aggregator use case ... how to accomplish individual completion intervals?

I have a use case that I need help with in the Camel Aggregator.

Timeout defines an amount of time to wait after each new message that gets
applied to a specific aggregated exchange. Different aggregations will then
accumulate for different amounts of time depending on message rep rate.

Interval defines a set period of time but applies to the global clock and
ends all aggregated exchanges when the time runs out.

What I need is an interval that applies per aggregated exchange. I have
messages coming in from different sources that need to be aggregated. With
the source ID serving as my correlation key, I need to start an aggregated
exchange that will wait for an interval of exactly 30 seconds then complete
(to account for the maximum amount of lag between associated messages). The
completion shouldn't interfere with any other in-process aggregated exchange
from a different source.

I can't assign a global interval because the sources all operate
independently of each other, but when they fire off messages they do so in
bursts then go quiet for an indeterminate amount of time. An interval could
end an aggregation prematurely. If, however, the indeterminate amount of
time actually ends up being 45 seconds later till another burst from the
same source then using completionTimeout runs into the problem of
aggregating separate bursts when the lag between messages causes the timeout
to push back too far.

How do I do this within the existing API and it's extension points? I didn't
see an obvious way. Or maybe I'm just blind. 

Thanks!
Allen





--
View this message in context: http://camel.465427.n5.nabble.com/Aggregator-use-case-how-to-accomplish-individual-completion-intervals-tp5751368.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Aggregator use case ... how to accomplish individual completion intervals?

Posted by bluewolfca <bl...@gmail.com>.
Claus Ibsen-2 wrote
> Hi
> 
> There is this ticket which is related to what you talk about
> https://issues.apache.org/jira/browse/CAMEL-7434
> 
> 
> -- 
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: 

> cibsen@

> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/


Thanks. Glad to hear this is being looked at.

Unfortunately for my time window, we need something coded, tested, and in
production by the end of September.

I'm guessing the next viable alternative would be to set up my own
ScheduledExecutorService and manage the correlation keys/lists there. When a
correlation key expires at the end of the interval send a control message to
the aggregator that stops the aggregated exchange via
completionPredicate/eagerCheckCompletion.

Any thoughts?

-Allen




--
View this message in context: http://camel.465427.n5.nabble.com/Aggregator-use-case-how-to-accomplish-individual-completion-intervals-tp5751368p5751443.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Aggregator use case ... how to accomplish individual completion intervals?

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

There is this ticket which is related to what you talk about
https://issues.apache.org/jira/browse/CAMEL-7434

On Tue, May 20, 2014 at 9:02 PM, bluewolfca <bl...@gmail.com> wrote:
> I have a use case that I need help with in the Camel Aggregator.
>
> Timeout defines an amount of time to wait after each new message that gets
> applied to a specific aggregated exchange. Different aggregations will then
> accumulate for different amounts of time depending on message rep rate.
>
> Interval defines a set period of time but applies to the global clock and
> ends all aggregated exchanges when the time runs out.
>
> What I need is an interval that applies per aggregated exchange. I have
> messages coming in from different sources that need to be aggregated. With
> the source ID serving as my correlation key, I need to start an aggregated
> exchange that will wait for an interval of exactly 30 seconds then complete
> (to account for the maximum amount of lag between associated messages). The
> completion shouldn't interfere with any other in-process aggregated exchange
> from a different source.
>
> I can't assign a global interval because the sources all operate
> independently of each other, but when they fire off messages they do so in
> bursts then go quiet for an indeterminate amount of time. An interval could
> end an aggregation prematurely. If, however, the indeterminate amount of
> time actually ends up being 45 seconds later till another burst from the
> same source then using completionTimeout runs into the problem of
> aggregating separate bursts when the lag between messages causes the timeout
> to push back too far.
>
> How do I do this within the existing API and it's extension points? I didn't
> see an obvious way. Or maybe I'm just blind.
>
> Thanks!
> Allen
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Aggregator-use-case-how-to-accomplish-individual-completion-intervals-tp5751368.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/