[rabbitmq-discuss] Is it possible to create/bind a queue so that it has a limit of N messages

Garrett Smith g at rre.tt
Tue Jan 26 17:32:09 GMT 2010


On Tue, Jan 26, 2010 at 1:58 AM, Matthias Radestock <matthias at lshift.net> wrote:
> Mark,
>
> Mark Geib wrote:
>> Is it possible to create a queue so that the broker will limit the
>> number of messages in the queue.? I am looking for a simple way to limit
>> resource usage of a broker should things go wrong, like a very chatty
>> producer... This is for a production system. I don't care if the
>> messages are lost or not.
>
> It would be fairly easy to add a per-queue message count limit to
> RabbitMQ, but it generally falls way short of constraining resources in
> a meaningful way to cope with "chatty" producers. Some reasons for that are:
> - queues are not directly associated with producers - in principle a
> producer can send messages that end up in any (and any number of) queue(s).
> - message counts do not constitute a good measure of resource usage;
> memory consumption would be a better measure but that is hard to
> determine with any degree of accuracy, due to the complexity of the data
> structures involved and the sharing of message data between queues

I know this has been brought up before a few times, but I've found
that TTL (time to live, expires, etc.) is an effective way to deal
with messages that aren't acked/canceled in a "timely" fashion (as per
the application).

Garrett




More information about the rabbitmq-discuss mailing list