[rabbitmq-discuss] Queue item limits

Simone Busoli simone.busoli at gmail.com
Thu Jan 26 23:40:04 GMT 2012


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.

On Fri, Jan 27, 2012 at 00:30, Codevally <codevally at gmail.com> wrote:

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


More information about the rabbitmq-discuss mailing list