On 09/19/2012 09:06 AM, Zhemzhitsky Sergey wrote:
Consider, there is a broker with a queue that contains 10 messages and receiver
with receiver capacity set to 5.
As I understand the broker will push 5 messages to the receiver to fill in its
internal queue and internal queue of receiver will contain 5 messages and
broker will contain 5 unpushed messages too.
Then I will call Receiver::fetch(Message&,bool) without acknowledging the
message.
Does it mean that receiver’s internal queue now has a free slot, so the broker
can push another message to it, so that the receiver can be considered to
receive 6 messages in total and broker can be considered to have 4 unpushed
messages?
The broker doesn't know about the free slot until the client library
tells it. In AMQP 0-10, the c++ client does this via a
session-completed, that includes the fetched message and thus moves the
prefetch window. However to avoid excessive back and forth traffic, the
c++ client will only send completions when the application has used up
half the prefetch.
So in your example, the client would only move the prefetch window on
the broker after the application fetched 3 messages. (At that point the
broker could send a further 3 messages).
Its quite possible this could be fine tuned a little more, or made
configurable (right now its hardcoded) if there are cases where a
slightly different approach would be preferred.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]