You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Robert Dare <ro...@gmail.com> on 2012/04/06 14:48:47 UTC

How to configure multiple consumers from @Consume + uri?

Hello everyone, and happy Friday!

I have a Spring web application that uses the @Consume annotation to pull
from an ActiveMQ queue.  Is it possible to configure this to create
multiple consumers from the queue?  I was hoping I could add something like
this:

@Consume(uri="activemq:queue:MyQueueName?maxConcurrentConsumers=10)

When the application is started I still see only one consumer of that queue
in the ActiveMQ admin console.

The class where I have this annotation is a Spring bean and is by default a
singleton.  I was hoping that the Consume annotation did some magic with
the underlying Camel context and threadPoolTaskExecutor.

If I want to have multiple consumers, do I need to create my consumers in a
pool, or is there a Camel way to handle this?



Many thanks,


Rob

Re: How to configure multiple consumers from @Consume + uri?

Posted by ajdobson <aj...@mtu.edu>.
I just tried adding concurrentConsumer=10 to my @Consume annotation and I do
not think it worked.

@Consume(uri="activemq:queue:MyQueue?concurrentConsumers=10")

When I go to ActiveMQ's admin page, the number of consumers for MyQueue
still shows 1.

Am I missing something?

--
View this message in context: http://camel.465427.n5.nabble.com/How-to-configure-multiple-consumers-from-Consume-uri-tp5622680p5623313.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to configure multiple consumers from @Consume + uri?

Posted by Robert Dare <ro...@gmail.com>.
Thanks Claus,

That worked like a charm!

On 4/6/12, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> There is a option concurrentConsumers which by default is 1.
> So in your case you have a pool of 1 to 10.
> Only on higher load it ought to increase.
>
> You can configure the @Consume and use concurrentConsumers=10, then
> you have a steady pool with 10 consumers.
>
> On Fri, Apr 6, 2012 at 2:48 PM, Robert Dare <ro...@gmail.com> wrote:
>> Hello everyone, and happy Friday!
>>
>> I have a Spring web application that uses the @Consume annotation to pull
>> from an ActiveMQ queue.  Is it possible to configure this to create
>> multiple consumers from the queue?  I was hoping I could add something
>> like
>> this:
>>
>> @Consume(uri="activemq:queue:MyQueueName?maxConcurrentConsumers=10)
>>
>> When the application is started I still see only one consumer of that
>> queue
>> in the ActiveMQ admin console.
>>
>> The class where I have this annotation is a Spring bean and is by default
>> a
>> singleton.  I was hoping that the Consume annotation did some magic with
>> the underlying Camel context and threadPoolTaskExecutor.
>>
>> If I want to have multiple consumers, do I need to create my consumers in
>> a
>> pool, or is there a Camel way to handle this?
>>
>>
>>
>> Many thanks,
>>
>>
>> Rob
>
>
>
> --
> Claus Ibsen
> -----------------
> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>

Re: How to configure multiple consumers from @Consume + uri?

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

There is a option concurrentConsumers which by default is 1.
So in your case you have a pool of 1 to 10.
Only on higher load it ought to increase.

You can configure the @Consume and use concurrentConsumers=10, then
you have a steady pool with 10 consumers.

On Fri, Apr 6, 2012 at 2:48 PM, Robert Dare <ro...@gmail.com> wrote:
> Hello everyone, and happy Friday!
>
> I have a Spring web application that uses the @Consume annotation to pull
> from an ActiveMQ queue.  Is it possible to configure this to create
> multiple consumers from the queue?  I was hoping I could add something like
> this:
>
> @Consume(uri="activemq:queue:MyQueueName?maxConcurrentConsumers=10)
>
> When the application is started I still see only one consumer of that queue
> in the ActiveMQ admin console.
>
> The class where I have this annotation is a Spring bean and is by default a
> singleton.  I was hoping that the Consume annotation did some magic with
> the underlying Camel context and threadPoolTaskExecutor.
>
> If I want to have multiple consumers, do I need to create my consumers in a
> pool, or is there a Camel way to handle this?
>
>
>
> Many thanks,
>
>
> Rob



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/