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: camel aggregator
Date Fri, 28 May 2010 04:23:37 GMT
On Thu, May 27, 2010 at 7:03 PM, marcin80 <mtroscia@gmail.com> wrote:
>
> Hi,
>
> I have a topic and consumer consuming messages from this topic. I'd like to
> save data from those messages to database using batch processing. I'm using
> aggregator EIP and processor like this:
>
> <camel:route>
>          <camel:from uri="activemq:topic:output"/>
>          <camel:aggregate batchSize="10">
>                <camel:correlationExpression>
>                        <camel:constant/>
>                </camel:correlationExpression>
>         <camel:process ref="testProcessor"/>
>         </camel:aggregate>
> </camel:route>
>
> But in process method of my processor I have single exchange while I expects
> list of exchanges (processor will save data to database).
>
> How can I solve my problem? I'm using Camel 2.2 (Fuse ESB 4.2).
>

http://camel.apache.org/aggregator.html

You can use the groupExchanges option to let the aggregator remember
the 10 incoming exchanges.
Otherwise you need to use an AggregationStrategy to "merge" the
outgoing result yourself.

> Cheers,
> Marcin
> --
> View this message in context: http://old.nabble.com/camel-aggregator-tp28697161p28697161.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

Mime
View raw message