qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: qpid for multiple producers and consumers
Date Thu, 18 Feb 2010 10:26:28 GMT
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 

@@ -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)
  	print content

Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org

View raw message