You're misunderstanding what the prefetch size is.  It doesn't mean the
broker dispatches messages in groups of N, it means that the broker
dispatches messages individually until there are N outstanding, and when a
message is acknowledged then another individual message will be dispatched
to get back to N.

The DispatchedQueueSize attribute you already found should always be equal
to the prefetch size (or working to get to the prefetch size).

A larger prefetch size won't reduce network traffic (in fact, it'll
increase it right after the consumer connects, because you're transferring
N-1 more messages to fill the prefetch buffer); rather it gives you a
buffer of available messages so the consumer isn't waiting for a network
transfer when you have a variable-speed network and/or a variable time to
consume messages.  If your network is fast and reliable and your messages
all take the same amount of time to process, prefetch doesn't do you any
good (and it makes it harder to load-balance across additional consumers).

Tim
On Mar 20, 2016 10:13 PM, "Raffi" <raffi.onj...@gmail.com> wrote:

> Is there a JMX metric for testing prefetch=1 vs prefetch=100? I want to
> confirm reduced network activity between consumer and broker when using
> large prefetchSize. DispatchedCounter and DispatchedQueueSize appear to
> increment/decrement by 1, never consistent with prefetchSize. I'm missing
> something simple, I know it :-)
>
>
>
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/How-to-test-prefetch-size-is-actually-working-tp4709766.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Reply via email to