On 12/14/2009 11:37 AM, Acácio Centeno wrote:
Hi,
We’re using QPid 0.5 and found a peculiar behaviour. We’re
wondering why that’s happening.
When the queue has elements, say 100, and we instantiate N
consumers, say 5, only the first one receives those elements on the queue.
Should we send new elements, they will be distributed among all the
consumers, but the “old ones” will be delivered only to the first consumer
(which we called internally “the hero” as it gets pretty stressed trying to
come up with the backlog).
Is this a bug, a known issue or not an issue at all but a
required behavior? If it’s a bug, is it fixed on the 0.6 release?
Which broker & client(s) are you using?
For the c++ broker, when the first subscription is added it will take as
many messages as it can get (subject to credit and ability to write to
the socket) and thus (especially if the messages are relatively small)
may get all 100 before the next subscription is ready to to compete with it.
You could try setting a finite credit window (default is infinite) to
make the distribution fairer. Assuming you are using the c++ client, you
do this by passing in SubscriptionSettings to the
SubscriptionManager::subscribe() call.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]