FAQ
in my route i want to aggregate exchanges based on a header value (a
processor extracts it from the body and sets the header)

the route looks like this:

from(direct).process(new SetCorrelationHeader).aggregate(header("id"), new
CustomAggregator).completion<What to set here?>.to(mock)

I want to aggregate all messages with same correlation key. How to achieve
this? (i can't make any assumptions about time or size)

Within the processor for each new group the oldExchange==null. So at the
moment i know that the prevoius group is complete the old exchange is sent
out already.

So how to implement the completion in this case? Probably
eagerCheckCompletion could help - but how?

(i am using camel 2.14.3 - upgrading is no option)



--
View this message in context: http://camel.465427.n5.nabble.com/aggreagator-completion-based-on-correlation-key-tp5772332.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Claus Ibsen at Oct 6, 2015 at 12:01 pm
    You can use a predicate as completion critereria.
    On Tue, Oct 6, 2015 at 1:57 PM, dermoritz wrote:
    in my route i want to aggregate exchanges based on a header value (a
    processor extracts it from the body and sets the header)

    the route looks like this:

    from(direct).process(new SetCorrelationHeader).aggregate(header("id"), new
    CustomAggregator).completion<What to set here?>.to(mock)

    I want to aggregate all messages with same correlation key. How to achieve
    this? (i can't make any assumptions about time or size)

    Within the processor for each new group the oldExchange==null. So at the
    moment i know that the prevoius group is complete the old exchange is sent
    out already.

    So how to implement the completion in this case? Probably
    eagerCheckCompletion could help - but how?

    (i am using camel 2.14.3 - upgrading is no option)



    --
    View this message in context: http://camel.465427.n5.nabble.com/aggreagator-completion-based-on-correlation-key-tp5772332.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    http://davsclaus.com @davsclaus
    Camel in Action 2nd edition:
    https://www.manning.com/books/camel-in-action-second-edition
  • Dermoritz at Oct 6, 2015 at 12:36 pm
    thanks,

    i did this, but it only works in conjunction with ".eagerCheckCompletion()".
    So in my processor that sets the correlation id i store the last id and if
    the id changes (the exchange will start a new group) i set an complete
    header.

    i will give a complete solution here:
    http://camel.465427.n5.nabble.com/Problem-with-custom-aggregation-custom-correlation-data-base-rows-td5772324.html



    --
    View this message in context: http://camel.465427.n5.nabble.com/aggreagator-completion-based-on-correlation-key-tp5772332p5772337.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Dermoritz at Oct 6, 2015 at 1:54 pm
    Ok i made some mistakes.

    The predicate with eagerCheckCompletion isn't working. It is very hard to
    test stuff that uses timeout (e.g. completion) with the debugger :-P

    So how to implement completion here? I know that the last group is complete
    if the correlation key changed. But where/how to implement?



    --
    View this message in context: http://camel.465427.n5.nabble.com/aggreagator-completion-based-on-correlation-key-tp5772332p5772339.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedOct 6, '15 at 11:57a
activeOct 6, '15 at 1:54p
posts4
users2
websitecamel.apache.org

2 users in discussion

Dermoritz: 3 posts Claus Ibsen: 1 post

People

Translate

site design / logo © 2022 Grokbase