[rabbitmq-discuss] Orderly purge of a queue without losing messages

Emile Joubert emile at rabbitmq.com
Tue Dec 13 18:11:40 GMT 2011

Hi Adam,

On 12/12/11 20:33, Adam Rabung wrote:
> I am working on a feature that will allow an admin to perform "bulk
> operations" against a single physical queue.  For example, the admin
> may want to say "In queue A, Delete all messages with publisher id =
> X".  Unfortunately, this system will be dealing with large backlogs,
> and the admin will need some means of selectively updating/deleting
> these backlogs.  Throttling publishers is not an option for me.

You could route messages by publisher and empty the relevant queue. If
the intention is to keep the queue length low by discarding
lower-priority messages then you should route messages to different
queues based on priority. This will make it possible to control the
length of the low priority queue, perhaps by using message expiry.

If bulk operations are an important part of your use-case and these
suggestions don't help then you should consider using a database with a
sufficiently expressive query language instead. Databases are much
better at manipulating large amounts of stationary data.


More information about the rabbitmq-discuss mailing list