qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Is getAvailable() always 0 when capacity is 0?
Date Mon, 02 Feb 2015 15:21:44 GMT
On 02/02/2015 03:13 PM, Toralf Lund wrote:
> The question is in the subject, really. To elaborate a bit, I'm talking
> about receiving AMQP-0.10 messages via qpid::Messaging::receiver in C++.
> Am I right to assume that getAvailable() only counts the messages
> already in the receiver, meaning that it must have a non-0 capacity for
> a meaningful output value?

Correct.

> I'm debugging an issue with an application where I've forgotten to call
> setCapacity(), or failed to realise at the time that I should use that
> method, if you know what I'm saying...

The capacity controls the number of 'pre-fetched' messages, i.e. 
messages sent by the broker (or peer) in anticipation of subsequent 
fetch() calls.

By default it is 0, meaning that messages are never sent prior to a 
fetch() but only in response to an explicit fetch(). The thinking behind 
this choice of default is that it led to more intuitive behaviour, but 
it's always hard to guess what is intuitive and its certainly subjective.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message