[rabbitmq-discuss] Fwd: chan.flow and vm_memory_high_watermark

Simon MacMullen simon at rabbitmq.com
Thu Jun 10 16:53:16 BST 2010


On 10/06/10 16:00, Nicolás César wrote:
> I'm sorry but I just don't get the use of basic_qos and fixed rate
> consuming toghether!. My investigation so far leads that the parameters
> I have for a QoS are:
>
> basic_qos(prefetch_size, prefetch_count, a_global)
>
> soppose that I use
>
> basic_qos(prefetch_size=0, prefetch_count=1, a_global=False)
>
>
> How can I limit "consume 1 message every 2 seconds" (that's my fixed
> rete) using chan.basic_consume(...callback = f)?

Those qos methods look reasonable. You would need to then delay the ack 
you send in the consume callback. Be careful not to just block there, 
that will block all the frames flowing down the connection on other 
channels. You need to use some sort of timer.

Are you using Pika? Marek has an example of this sort of thing at:

http://github.com/majek/pika/blob/master/examples/demo_channel_flow_asyncore.py

Cheers, Simon


More information about the rabbitmq-discuss mailing list