<p>Hi Mike, I&#39;m quite new to RabbitMQ but I think there are at least a couple of things you can look into. One is QoS, which regulates how many messages a consumer is being pushed in advance, setting it to 1 should mean that no messages are sent to it before it can consume the one it has on its queue. Second, you can look at ACKs, which let you cope with the scenario you are describing, since failing to ack messages implies that they stay on the queue and can be recovered later.</p>

<div class="gmail_quote">On Jul 7, 2011 9:58 AM, &quot;Mike Hadlow&quot; &lt;<a href="mailto:mike.hadlow@15below.com">mike.hadlow@15below.com</a>&gt; wrote:<br type="attribution">&gt; Hi All,<br>&gt; <br>&gt; I&#39;m writing a high-level &quot;opinionated&quot; .NET API on top of the supplied RabbitMQ .NET client that I&#39;ve named EasyNetQ. It&#39;s on GitHub here:<br>
&gt; <br>&gt; <a href="https://github.com/mikehadlow/EasyNetQ">https://github.com/mikehadlow/EasyNetQ</a><br>&gt; <br>&gt; Currently I&#39;m using the QueueingBasicConsumer and spinning up a single thread that sits in a loop doing SharedQueue.Dequeue(), see the code here:<br>
&gt; <br>&gt; <a href="https://github.com/mikehadlow/EasyNetQ/blob/master/EasyNetQ/QueueingConsumerFactory.cs">https://github.com/mikehadlow/EasyNetQ/blob/master/EasyNetQ/QueueingConsumerFactory.cs</a><br>&gt; <br>&gt; My question is about the scenario where messages are being pushed onto the queue by QueueingBasicConsumer faster than my client callbacks can handle them. Surely messages will build up in the SharedQueue until we run out of memory, crash, and lose all the queued messages? It would be much better if messages were pulled from RabbitMQ only as fast as the consumers can process them.<br>
&gt; <br>&gt; Does anyone have any experience with this scenario? What is the recommended subscription pattern? Should I be using BasicGet instead?<br>&gt; <br>&gt; Many thanks<br>&gt; Mike<br>&gt; <br>&gt; 15below Limited: Company registered in England and Wales No 3945289<br>
&gt; Registered Office: Lyndean House, 43-46 Queens Road, Brighton BN1 3XB, United Kingdom<br>&gt; <br>&gt; 15below Australia Pty Limited: ABN 25 132 716 379<br>&gt; Level 50, 120 Collins Street, Melbourne, Victoria 3000, Australia<br>
&gt; <br>&gt; Please think about the environment before printing this email.<br>&gt; <br>&gt; ************************************************************************<br>&gt; This email and any attachments may be confidential and/or legally privileged and are solely for the use of the intended recipient. If you have received this email in error please contact the sender. Any views or opinions expressed within this e-mail are solely those of the sender, and do not necessarily represent those of 15below unless otherwise specifically stated. Although 15below has taken every reasonable precaution to ensure that any attachment to this e-mail has been checked for viruses, it is strongly recommended that you carry out your own virus check before opening any attachment, as we cannot accept liability for any damage sustained as a result of software virus infection.<br>
</div>