<font face="trebuchet ms,sans-serif">This is not supported out of the box, you'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"><<a href="mailto:codevally@gmail.com">codevally@gmail.com</a>></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 <<a href="mailto:em...@rabbitmq.com">em...@rabbitmq.com</a>> wrote:<br>
> Hi,<br>
><br>
> On 25/01/12 07:11, Simone Busoli wrote:<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> > There is no such feature in the broker, perhaps if you explain what you<br>
> > are trying to do there may be other ways.<br>
><br>
</div>> > On Jan 25, 2012 1:43 AM, "Codevally" <<a href="mailto:codeva...@gmail.com">codeva...@gmail.com</a><br>
<div class="im HOEnZb">> > <mailto:<a href="mailto:codeva...@gmail.com">codeva...@gmail.com</a>>> wrote:<br>
><br>
> > This is something like restrict the size of the queue. Please help.<br>
><br>
> > On Jan 25, 11:38 am, Codevally <<a href="mailto:codeva...@gmail.com">codeva...@gmail.com</a><br>
> > <mailto:<a href="mailto:codeva...@gmail.com">codeva...@gmail.com</a>>> wrote:<br>
> > > Hi<br>
><br>
> > > I have a declared queue and want to know how can I limit the<br>
> > number of<br>
> > > items in that queue. For example, the define queue is "sms_gateway"<br>
> > > and that queue can maximum allow to receive 500 items.<br>
><br>
> As Simone says, there is no way of limiting the number of messages in a<br>
> queue. The closest approximation is to limit the time that messages may<br>
> spend in a queue.<br>
><br>
> <a href="http://www.rabbitmq.com/extensions.html#lifetimes" target="_blank">http://www.rabbitmq.com/extensions.html#lifetimes</a><br>
><br>
> -Emile<br>
</div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> rabbitmq-discuss mailing list<br>
> 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>