You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by MARollins <ma...@poz.im> on 2010/11/05 12:26:54 UTC

Prefetch problem

Hi,

I'm running ActiveMQ 5.3. I have a single consumer which receives (large -
up to 4MB) messages from a queue and after some checking, emails them. The
problem I have is that the prefetch doesn't seem to be working. 

Because of the size of the messages and client memory limitations, I have
set the prefetch to 1, so that just a single message is dispatched at a time
(or so I thought).

I did this using the following...

Queue.Name?jms.prefetchPolicy.queuePrefetch=1

in the call to session.createConsumer.

When I debug the client aplication and look at the console I can see ...

562 enqueued (as expected), 
0 dequeued (as expected)
562 dispatched,
562 dispatched queue

(I have a breakpoint in the messageHandler where I have stopped on receipt
of the first message). 

I was expecting to see just 1 message dispatched. If I then let the
application run, it very quickly runs out of memory.

Any help would be appreciated.

Thanks




-- 
View this message in context: http://activemq.2283324.n4.nabble.com/Prefetch-problem-tp3028494p3028494.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Prefetch problem

Posted by MARollins <ma...@poz.im>.
...even better.

Thanks Gary
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/Prefetch-problem-tp3028494p3028879.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Prefetch problem

Posted by Gary Tully <ga...@gmail.com>.
yea, that will work, the syntax for the destination options you were
using is different from the broker uri parameters that you have
working. Some info on the original destination options syntax at :
http://activemq.apache.org/destination-options.html

On 5 November 2010 11:58, MARollins <ma...@poz.im> wrote:
>
> ...looks like I've just solved it!!
>
> The prefetch should be set on the connection as follows...
>
> tcp://SERVERNAME:61616?wireFormat.maxInactivityDuration=0&jms.prefetchPolicy.all=1
>
>
> Thanks!!
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Prefetch-problem-tp3028494p3028523.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com
http://fusesource.com

Re: Prefetch problem

Posted by MARollins <ma...@poz.im>.
...looks like I've just solved it!!

The prefetch should be set on the connection as follows...

tcp://SERVERNAME:61616?wireFormat.maxInactivityDuration=0&jms.prefetchPolicy.all=1


Thanks!!
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/Prefetch-problem-tp3028494p3028523.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.