activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcharles <john.char...@ttmsolutions.com>
Subject Re: A question about prefetch with NMS
Date Mon, 27 Oct 2008 02:04:18 GMT



mkeenan wrote:
> 
> I'm using NMS version 1.1 and AMQ version 5.2
> 
> When I set the connection string in the client API to:
> 
> tcp://localhost:61616?jms.prefetchPolicy.all=1
> 
> I *thought* that was going to give me a prefetch buffer of 1 for all
> consumers.  Looking at the Subscribers in the JMX console the consumers
> have the default prefetch of 1000.
> 
> In order to get the prefetch set I have to set it on all consumers, ex:
> 
> MyQueueName?consumer.prefetchSize=1
> 
> It would be nice to set it globally. Am I doing something wrong?  Could I
> be setting this in the broker by putting jms.prefetchPolicy.all in the URI
> attribute of the openwire transport connector?
> 

The prefetch limit allows the client to notify the broker of how many
messages it can buffer before reading. Upon reaching that limit the broker
buffers new messages until such time as the client has consumed some of the
messages. Not all clients are the same, some clients are slower than others
at processing messages because they need to perform additional business
logic on incoming messages i.e. persisting info to a database or sync with
other applications. As such the prefetch limit is a client issue. The 2
forms of configuration reflect this, either assigned in the client
connection url or associated with a destination again configured by the
client.

I guess your idea would be to add an attribute to a broker destination that
sets an overriding prefetch limit for destinations created by the broker on
startup.  It doesn't sound unreasonable but perhaps others have more
insights.

John C - Get a free ActiveMQ 5 User Guide at www.ttsolutions.com

-- 
View this message in context: http://www.nabble.com/A-question-about-prefetch-with-NMS-tp20157793p20180696.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message