Hi Dan, in AMQP 0-9-1 there is only one notion of "acknowledgement" which is what the prefetch is based on, so a new message will only be sent to the client when it has acknowledged (taken responsibility for / asked to be dequeued) the previous message.
AMQP 0-10 allows for the separation the notion of accepting the message from the notion of confirming the receipt. Thus flow control can be based on knowing that the message has been received (but not yet acknowledged) by the client application. (If the 0-9-1 client were smarter it could have a mode where it automatically increases the window when it knows that it has delivered a message to the application but they have not yet acknowledged it... however the client is not (yet) that smart). Hope this helps, Rob On 4 September 2014 02:20, xiaodan.wang <[email protected]> wrote: > Hi guys, we recently switched from protocol version AMQP 0-10 to AMQP 0-91 > on > the v0.32 client and noticed that the behavior for synchronous consumers > (consumer.receive) has changed. For example, in AMQP 0-10, if we enqueue 5 > messages to queue Q1, then calling "receive" on a consumer that is > listening > to Q1 5 times in succession will return all 5 messages. However with AMQP > 0-91, calling "receive" will only return the first message and subsequent > invocations will hang/time out even though there are additional messages > sitting on Q1 (we tested with a single consumer). > > In both AMQP 0-10 and AMQP 0-91, we are using transacted sessions with max > prefetch of 1. We did notice that changing max prefetch to 3 in AMQP 0-91 > allowed us to consume up to 3 messages synchronously and so on. While > intuitively this makes sense, we could not figure out why AMQP 0-10 allows > us to consume multiple messages synchronously with prefetch=1 while AMQP > 0-91 does not. > > Cheers! Dan > > Context on why we switched from AMQP 0-91 to AMQP 0-10 with prefetch=1: > > http://qpid.2158936.n2.nabble.com/Re-1-Queue-with-2-Consumers-turn-off-pre-fetching-td6934582.html > > > > > -- > View this message in context: > http://qpid.2158936.n2.nabble.com/Synchronous-consumer-can-only-dequeue-1-message-in-AMQP-0-91-tp7613017.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] > >
