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: How does an aggregator behave with multiple consumers?
Date Mon, 21 Dec 2009 14:04:19 GMT
On Mon, Dec 21, 2009 at 2:27 PM, ee7arh <andrew.hurst@2e-systems.com> wrote:
>
> Hi,
>
> When you have a route with mutliple concurrent consumers and this route
> contains an aggregator, does the aggregator aggregate messages from all
> consumer threads or is there in effect a separate aggregator per consumer
> thread?
>
> I have following route which is currently set to 1 concurrentConsumer. Can I
> safely increment this to a higher value knowing that all messages which go
> through the route will be aggregated together as necessary or does each
> concurrent consumer start it's own aggregator in which case a total redesign
> is required?
>
>  from("activemq:queue:NotificationsToSend?maxConcurrentConsumers=1&concurrentConsumers=1")
>             .to("bean:" + NotificationsHandler.serviceName +
> "?method=sendNotification")
>             .to("bean:" + NotificationsHandler.serviceName +
> "?method=saveNotificationData")
>
>             // Aggregate by IdHeader to group the exchanges together
>             .aggregate(header("IdHeader"), new
> GroupedExchangeAggregationStrategy())
>
>  .completionPredicate(header("aggregated").isEqualTo(header(Handler.EXPECTED_NOTIF_HEADER)))
>
>             // Update the notification status accordingly
>             .to("bean:" + SchedChgHandler.serviceName +
> "?method=updateNotificationStatus");
>
> Thanks and BRegards
> Andrew
>

Hi

You can ask the computer :) And try it out.

But the answer is: there is one instance of the Aggregator so they
will all get aggregated, no matter how many concurrent consumers you
have.



> --
> View this message in context: http://old.nabble.com/How-does-an-aggregator-behave-with-multiple-consumers--tp26873948p26873948.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