On 02/16/2010 04:31 PM, Ramashish Baranwal wrote:

Try setting flow control such that each consumer only gets one message at a
time. I.e. instead of calling start() on the incoming queue (which gives
unlimited credit) allocate credit yourself. (Attached patch attempts to
describe that more precisely).

--Gordon.


Thanks Gordon! That worked. So it seems the flow control will make the
client receive one message at a time, right? However, after receiving
just one message, the queue.get() is timing out. Do I need to do
something else to continue receiving more messages one at a time?

Yes, you can 'move' the credit window by sending completions. There may now be a more elegant way of doing this (Rafi?), but the following will work:

@@ -83,6 +85,8 @@
 while content != final:
        message = queue.get(timeout=10)
        content = message.body
+        session.receiver._completed.add(message.id)
+        session.channel.session_completed(session.receiver._completed)
         session.message_accept(RangedSet(message.id))
        print content

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to