Hi Robbie, sorry to resurrect an old thread :)

We are seeing an interesting behavior on the Qpid Java client with respect
to prefetching of messages (maxprefetch). Based on documentation from the
following link, we believe that the prefetch buffer is defined on a per
session basis. However, after running a few benchmarks, the prefetch buffer
seems to be allocated on a per consumer (or per destination queue, not sure
which one) basis. Namely, when we setup multiple consumers using the same
session, each consumer is buffering separately. Is this the expected
behavior? If so, can you suggest a workaround to either turn off client side
prefetching or have prefetch buffers scoped at the session level.

https://qpid.apache.org/releases/qpid-0.26/jms-client-0-8/book/JMS-Client-0-8-Client-Understanding-Session.html

We configured Qpid with asynchronous onMessage delivery with transacted
session. Prefetch count on the client is set to 1 (setting prefetch to 0 did
not solve our issue). The experiment involves 2 sessions (A and B) and 2
destination queues (Q1 and Q2). Each session creates 2 consumers that listen
on Q1 and Q2 respectively. Next, we enqueue 2 messages, one long running
message on Q1 and a short running message on Q2. A consumer on session A
pulls the long running message from Q1 and starts working on it. In the
meantime, session B does nothing even though there is an unconsumed message
on Q2. Once session A finishes the long running messages, it consumes the
message from Q2.

This seems to contradict our expectation. So we suspected that the prefetch
buffer is allocated for each consumer on a session (i.e. for session A, with
prefetch of 1, it will buffer 1 message from Q1 and 1 for Q2 for a total of
2 messages). To test this theory, we modified the above experiment to use a
single destination queue (Q1) and consumer for sessions A and B. We enqueued
both long running and short running messages in Q1 and did not observe any
instance in which a consumer was doing nothing while an unconsumed message
was sitting on the queue. (We repeated this several times with many
messages).

This seems to indicate that there is a separate prefetch buffer for each
consumer within the same session. Thanks in advance for any help
interpreting this behavior!

Cheers! Dan



--
View this message in context: 
http://qpid.2158936.n2.nabble.com/Re-1-Queue-with-2-Consumers-turn-off-pre-fetching-tp6934582p7612403.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to