You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by osian <os...@osian.me.uk> on 2006/05/09 16:30:06 UTC

Single Consumer vs Multi Consumer on Restart

I am utilising ActiveMQ's wildcard support i.e. BASEQUEUENAME.> for all of my
consumers, I have around 5000 messages in my queue which is stored in a
database.  When I start a single consumer, the broker will load 1000
messages and then start handing out the messages to the single cosumer that
is connected, and this is fast and reliable, and I can also see that each
time a message is consumed, it fetches another from the DB, i.e. 1001, 1002,
etc.  Unfortunately, when I add another consumer with the same setting's
(i.e. it can process any queue) everything seems to grind to a halt because
ActiveMQ seems to fetch another 1000 messages.  

So my question is, is there any way of configuring how many messages it
should pre-fetch when a new consumer connects, so that I can try and
optimise it for the number of consumers, because eventually I will have at
least a hundred consumers, and if each of these try and pre-fetch a 1000
messages on startup, which in turn holds up processing, it will slow down
the initial restart of the server,
Cheers.
--
View this message in context: http://www.nabble.com/Single-Consumer-vs-Multi-Consumer-on-Restart-t1584953.html#a4301014
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Single Consumer vs Multi Consumer on Restart

Posted by osian <os...@osian.me.uk>.
what I meant was, when the consumer is connecting to the broker the
connection url is 'queueName?consumer.prefetchSize=10', so I believe that
this covers the setting of the prefetch size instead of setting it manually
--
View this message in context: http://www.nabble.com/Single+Consumer+vs+Multi+Consumer+on+Restart-t1584953.html#a4502858
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Single Consumer vs Multi Consumer on Restart

Posted by James Strachan <ja...@gmail.com>.
On 5/18/06, osian <os...@osian.me.uk> wrote:
>
> This is already specified in the fetch URL i.e. consumer.prefetchSize=10

Could you be more specific?


> --
> View this message in context: http://www.nabble.com/Single-Consumer-vs-Multi-Consumer-on-Restart-t1584953.html#a4446537
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: Single Consumer vs Multi Consumer on Restart

Posted by osian <os...@osian.me.uk>.
This is already specified in the fetch URL i.e. consumer.prefetchSize=10
--
View this message in context: http://www.nabble.com/Single-Consumer-vs-Multi-Consumer-on-Restart-t1584953.html#a4446537
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Single Consumer vs Multi Consumer on Restart

Posted by Adrian Co <ac...@exist.com>.
You could change the prefetch policy either through the connection factory or
the actual connection. Use
ActiveMQConnectionFactory.getPrefetchPolicy().setXXXPrefetch(int); or
ActiveMQConnection.getPrefetchPolicy().setXXXPrefetch(int);

Hope this helps.

Regards,
Adrian Co
--
View this message in context: http://www.nabble.com/Single-Consumer-vs-Multi-Consumer-on-Restart-t1584953.html#a4445764
Sent from the ActiveMQ - User forum at Nabble.com.