<font face="trebuchet ms,sans-serif">This is not supported out of the box, you&#39;d have to write something at a higher level to do that. There may be workarounds if you explain a bit more about your architecture. For example the declare-ok reply when you declare a queue carries the number of messages in the queue, or you may be able to leverage the prefetch-count option to limit the number of messages delivered to a consumer before it acks them, or else use the channel flow control, but the feasibility of each depends a lot on how you have set up your system.<br>

</font><br><div class="gmail_quote">On Fri, Jan 27, 2012 at 00:30, Codevally <span dir="ltr">&lt;<a href="mailto:codevally@gmail.com">codevally@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Thanks Emile and Simone for your replies.<br>
<br>
But I want to limit the number of items in the queue and not their<br>
live in the queue.<br>
<br>
Basically my requirement is, I have a queue (called sms_gateway) and I<br>
have several companies publishing messages to that queue. But want to<br>
allocate some big number of size to higher priority companies. Like:<br>
<br>
ABC Company can have maximum of 1000 messages in the sms_gateway<br>
XYZ Company can have maximum of 200 �messages in the sms_gateway<br>
PQR Company can have maximum of 100 �messages in the sms_gateway<br>
<br>
Thanks.<br>
<div class="im"><br>
On Jan 25, 10:31�pm, Emile Joubert &lt;<a href="mailto:em...@rabbitmq.com">em...@rabbitmq.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; On 25/01/12 07:11, Simone Busoli wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &gt; There is no such feature in the broker, perhaps if you explain what you<br>
&gt; &gt; are trying to do there may be other ways.<br>
&gt;<br>
</div>&gt; &gt; On Jan 25, 2012 1:43 AM, &quot;Codevally&quot; &lt;<a href="mailto:codeva...@gmail.com">codeva...@gmail.com</a><br>
<div class="im HOEnZb">&gt; &gt; &lt;mailto:<a href="mailto:codeva...@gmail.com">codeva...@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt; &gt; � � This is something like �restrict the size of the queue. Please help.<br>
&gt;<br>
&gt; &gt; � � On Jan 25, 11:38 am, Codevally &lt;<a href="mailto:codeva...@gmail.com">codeva...@gmail.com</a><br>
&gt; &gt; � � &lt;mailto:<a href="mailto:codeva...@gmail.com">codeva...@gmail.com</a>&gt;&gt; wrote:<br>
&gt; &gt; � � �&gt; Hi<br>
&gt;<br>
&gt; &gt; � � �&gt; I have a declared queue and want to know how can I limit the<br>
&gt; &gt; � � number of<br>
&gt; &gt; � � �&gt; items in that queue. For example, the define queue is &quot;sms_gateway&quot;<br>
&gt; &gt; � � �&gt; and that queue can maximum allow to receive 500 items.<br>
&gt;<br>
&gt; As Simone says, there is no way of limiting the number of messages in a<br>
&gt; queue. The closest approximation is to limit the time that messages may<br>
&gt; spend in a queue.<br>
&gt;<br>
&gt; <a href="http://www.rabbitmq.com/extensions.html#lifetimes" target="_blank">http://www.rabbitmq.com/extensions.html#lifetimes</a><br>
&gt;<br>
&gt; -Emile<br>
</div><div class="HOEnZb"><div class="h5">&gt; _______________________________________________<br>
&gt; rabbitmq-discuss mailing list<br>
&gt; rabbitmq-disc...@lists.rabbitmq.comhttps://<a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</div></div></blockquote></div><br>