You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by gng <ga...@hp.com> on 2010/08/24 16:03:11 UTC

Specifying prefetch topic sizes in configuration files

I'm trying to configure topic prefetch sizes in the activemq.xml config file
(as opposed to, for example, in the connection URL as documented at
http://activemq.apache.org/what-is-the-prefetch-limit-for.html). Can anyone
supply a code snippet or provide the documentation reference ?

Thanks.
-- 
View this message in context: http://old.nabble.com/Specifying-prefetch-topic-sizes-in-configuration-files-tp29522337p29522337.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Specifying prefetch topic sizes in configuration files

Posted by gng <ga...@hp.com>.
Thanks. In the end all I needed to do apparently was to add the
"topicPrefetch" attribute as follows :-

<policyEntry topic=">" topicPrefetch="100000" producerFlowControl="true"
memoryLimit="1mb">

I assume this would do the job. Is there any way in activeMQ's admin
interface where I can check to see that the new topic preFetch size being
applied and that the default is still not being used ?
-- 
View this message in context: http://old.nabble.com/Specifying-prefetch-topic-sizes-in-configuration-files-tp29522337p29540066.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Specifying prefetch topic sizes in configuration files

Posted by Gary Tully <ga...@gmail.com>.
http://activemq.apache.org/wildcards.html

On 25 August 2010 15:04, gng <ga...@hp.com> wrote:
>
>
> Gary Tully wrote:
>>
>> peek at the schema, there is also a topicPrefetch and
>> durableTopicPrefetch attributes. You need topicPrefetch I guess. then
>> it looks ok.
>>
>
> Thanks - finally, is there a wildcard character that can be used to indicate
> all topics should be affected ? Something like :-
>
> <policyEntry topic="*">
>
> where "*" denotes all topics...
>
>
> --
> View this message in context: http://old.nabble.com/Specifying-prefetch-topic-sizes-in-configuration-files-tp29522337p29532655.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: Specifying prefetch topic sizes in configuration files

Posted by gng <ga...@hp.com>.

Gary Tully wrote:
> 
> peek at the schema, there is also a topicPrefetch and
> durableTopicPrefetch attributes. You need topicPrefetch I guess. then
> it looks ok.
> 

Thanks - finally, is there a wildcard character that can be used to indicate
all topics should be affected ? Something like :-

<policyEntry topic="*">

where "*" denotes all topics... 


-- 
View this message in context: http://old.nabble.com/Specifying-prefetch-topic-sizes-in-configuration-files-tp29522337p29532655.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Specifying prefetch topic sizes in configuration files

Posted by Gary Tully <ga...@gmail.com>.
peek at the schema, there is also a topicPrefetch and
durableTopicPrefetch attributes. You need topicPrefetch I guess. then
it looks ok.

On 25 August 2010 14:37, gng <ga...@hp.com> wrote:
>
>
> Gary Tully wrote:
>>
>> yea, need to add it there, it is in the schema though:
>> view-source:http://activemq.apache.org/schema/core/activemq-core-5.4.0.xsd
>>
>> that is always the most up to date reference
>>
>
> Thanks Gary - so I'm using v5.3.2 and the queuePrefetch attribute is there.
> I want to change the pre fetch size for a non-durable topic from its default
> value of 32766 to something much larger. So I believe I need to add a
> section to my activemq.xml conf file as follows (for the topic I have
> defined called "myTopic") :-
>
> <destinationPolicy>
> <policyMap>
> <policyEntries>
> <policyEntry topic="myTopic">
> <!-- ** is the line below correct to change the prefetch size for the
> myTopic topic from its default to the new value ? ** -->
> <prefetchPolicy queuePrefetch="100000"/>
> </policyEntry>
> </policyEntries>
> </policyMap>
> </destinationPolicy>
>
> Is the code snippet above correct ?
>
> Again, thanks for the assistance !
>
>
>
> --
> View this message in context: http://old.nabble.com/Specifying-prefetch-topic-sizes-in-configuration-files-tp29522337p29532357.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: Specifying prefetch topic sizes in configuration files

Posted by gng <ga...@hp.com>.

Gary Tully wrote:
> 
> yea, need to add it there, it is in the schema though:
> view-source:http://activemq.apache.org/schema/core/activemq-core-5.4.0.xsd
> 
> that is always the most up to date reference
> 

Thanks Gary - so I'm using v5.3.2 and the queuePrefetch attribute is there.
I want to change the pre fetch size for a non-durable topic from its default
value of 32766 to something much larger. So I believe I need to add a
section to my activemq.xml conf file as follows (for the topic I have
defined called "myTopic") :-

<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic="myTopic">
<!-- ** is the line below correct to change the prefetch size for the
myTopic topic from its default to the new value ? ** -->
<prefetchPolicy queuePrefetch="100000"/>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>

Is the code snippet above correct ?

Again, thanks for the assistance !



-- 
View this message in context: http://old.nabble.com/Specifying-prefetch-topic-sizes-in-configuration-files-tp29522337p29532357.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Specifying prefetch topic sizes in configuration files

Posted by Gary Tully <ga...@gmail.com>.
yea, need to add it there, it is in the schema though:
view-source:http://activemq.apache.org/schema/core/activemq-core-5.4.0.xsd

that is always the most up to date reference

On 24 August 2010 16:11, gng <ga...@hp.com> wrote:
>
>
> Gary Tully wrote:
>>
>> there is a queuePrefetch attribute in the policy entry that can apply
>> to all consumes that don't have a preference. See how to configure at:
>> http://activemq.apache.org/per-destination-policies.html
>>
>> On 24 August 2010 15:03, gng <ga...@hp.com> wrote:
>>>
>>> I'm trying to configure topic prefetch sizes in the activemq.xml config
>>> file
>>> (as opposed to, for example, in the connection URL as documented at
>>> http://activemq.apache.org/what-is-the-prefetch-limit-for.html). Can
>>> anyone
>>> supply a code snippet or provide the documentation reference ?
>>>
>>> Thanks.
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Specifying-prefetch-topic-sizes-in-configuration-files-tp29522337p29522337.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>>
>> --
>> http://blog.garytully.com
>>
>> Open Source Integration
>> http://fusesource.com
>>
>
> Thanks Gary - maybe I'm missing something but I do not see a "queuePrefetch"
> attribute documented at
> http://activemq.apache.org/per-destination-policies.html ...
>
> --
> View this message in context: http://old.nabble.com/Specifying-prefetch-topic-sizes-in-configuration-files-tp29522337p29523082.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: Specifying prefetch topic sizes in configuration files

Posted by gng <ga...@hp.com>.

Gary Tully wrote:
> 
> there is a queuePrefetch attribute in the policy entry that can apply
> to all consumes that don't have a preference. See how to configure at:
> http://activemq.apache.org/per-destination-policies.html
> 
> On 24 August 2010 15:03, gng <ga...@hp.com> wrote:
>>
>> I'm trying to configure topic prefetch sizes in the activemq.xml config
>> file
>> (as opposed to, for example, in the connection URL as documented at
>> http://activemq.apache.org/what-is-the-prefetch-limit-for.html). Can
>> anyone
>> supply a code snippet or provide the documentation reference ?
>>
>> Thanks.
>> --
>> View this message in context:
>> http://old.nabble.com/Specifying-prefetch-topic-sizes-in-configuration-files-tp29522337p29522337.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> -- 
> http://blog.garytully.com
> 
> Open Source Integration
> http://fusesource.com
> 

Thanks Gary - maybe I'm missing something but I do not see a "queuePrefetch"
attribute documented at
http://activemq.apache.org/per-destination-policies.html ...

-- 
View this message in context: http://old.nabble.com/Specifying-prefetch-topic-sizes-in-configuration-files-tp29522337p29523082.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Specifying prefetch topic sizes in configuration files

Posted by Gary Tully <ga...@gmail.com>.
there is a queuePrefetch attribute in the policy entry that can apply
to all consumes that don't have a preference. See how to configure at:
http://activemq.apache.org/per-destination-policies.html

On 24 August 2010 15:03, gng <ga...@hp.com> wrote:
>
> I'm trying to configure topic prefetch sizes in the activemq.xml config file
> (as opposed to, for example, in the connection URL as documented at
> http://activemq.apache.org/what-is-the-prefetch-limit-for.html). Can anyone
> supply a code snippet or provide the documentation reference ?
>
> Thanks.
> --
> View this message in context: http://old.nabble.com/Specifying-prefetch-topic-sizes-in-configuration-files-tp29522337p29522337.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: Specifying prefetch topic sizes in configuration files

Posted by gng <ga...@hp.com>.


Glen Mazza wrote:
> 
> This shows how it can be done in the web.xml:
> http://activemq.apache.org/rest.html#REST-Consuming
> 
> Would that work for you?
> 
> gng wrote:
>> I'm trying to configure topic prefetch sizes in the activemq.xml config
>> file
>> (as opposed to, for example, in the connection URL as documented at
>> http://activemq.apache.org/what-is-the-prefetch-limit-for.html). Can
>> anyone
>> supply a code snippet or provide the documentation reference ?
>>
>> Thanks.
>>   
> 

Thanks, but I have a number of publishers who are publishing messages to
various topics. The publishers access the broker via a jndi lookup and then
use the api calls to set up the session, compose the message and publish it
(in other words, not via a REST interface). That's why I was hoping to set
something in the activemq.xml config file.

-- 
View this message in context: http://old.nabble.com/Specifying-prefetch-topic-sizes-in-configuration-files-tp29522337p29522806.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Specifying prefetch topic sizes in configuration files

Posted by Glen Mazza <gl...@gmail.com>.
This shows how it can be done in the web.xml:
http://activemq.apache.org/rest.html#REST-Consuming

Would that work for you?

gng wrote:
> I'm trying to configure topic prefetch sizes in the activemq.xml config file
> (as opposed to, for example, in the connection URL as documented at
> http://activemq.apache.org/what-is-the-prefetch-limit-for.html). Can anyone
> supply a code snippet or provide the documentation reference ?
>
> Thanks.
>