You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by mkeenan <ke...@p2sol.com> on 2008/10/24 23:46:55 UTC

A question about prefetch with NMS

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?
-- 
View this message in context: http://www.nabble.com/A-question-about-prefetch-with-NMS-tp20157793p20157793.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: A question about prefetch with NMS

Posted by jfcharles <jo...@ttmsolutions.com>.


mkeenan wrote:
> 
> 
> jfcharles wrote:
>> 
>> The 2 forms of configuration reflect this, either assigned in the client
>> connection url or associated with a destination again configured by the
>> client.
>> 
> 
> Thanks for your response.
> 
> To clarify my original post-- when I tried to set it in the client URL is
> not working for me. It does work on a per-destination setting. So my
> question was: Is there a mistake in my notation when trying to set it in
> the client URL for all destinations.
> 
> The question about setting it at the broker level was more of a
> "workaround" since I couldn't get it working globally at the client level
> without setting it on each destination.
> 
> 

I see. The syntax looks fine to me. Perhaps write a simple Java client and
use the same connection parameters to see if there is a problem. If there is
then try against AMQ5.1. (I am pretty sure that version of AMQ will work).
If neither of those reveal a problem it looks like a problem in the NMS
library.

A bit of trial and error should isolate the problem.

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


Re: A question about prefetch with NMS

Posted by mkeenan <ke...@p2sol.com>.

jfcharles wrote:
> 
> The 2 forms of configuration reflect this, either assigned in the client
> connection url or associated with a destination again configured by the
> client.
> 

Thanks for your response.

To clarify my original post-- when I tried to set it in the client URL is
not working for me. It does work on a per-destination setting. So my
question was: Is there a mistake in my notation when trying to set it in the
client URL for all destinations.

The question about setting it at the broker level was more of a "workaround"
since I couldn't get it working globally at the client level without setting
it on each destination.

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


Re: A question about prefetch with NMS

Posted by jfcharles <jo...@ttmsolutions.com>.


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.