[rabbitmq-discuss] Queue and filtering questions

Andrew Esler aj.esler at gmail.com
Wed Nov 16 23:42:56 GMT 2011


I am looking at using RabbitMQ for a prototype project I am doing. I
have a couple of questions:

1. Is there a way to have a queue that deletes messages if there are
no consumers attached? I don't want to use autoDelete, as I want
consumers to be able to attach and detach at any time and have the
queue exist.

2. Is there any way to attach a filter to the end of a queue, so that
when a client wants the next message, the message passes through the
filter and may be discarded, and the next message in the queue
considered for delivery to the client. Ideally, it would be possible
to hook into a Java program so that I can check that the message is
one the program should send. Obviously, this will introduce a
potentially large performance overhead, but that is unlikely to be a
problem in my case, as I am not dealing with a particularly high
throughput.

The use case is when I am receiving results from workers for a task,
where each task may produce many results that are put in an output
queue. In order to make the system fault tolerant to a worker becoming
unresponsive or failing, I would like to be able to filter messages
from the output queue that were sent before the worker failed so they
are not delivered twice.
Buffering the messages on the workers is not an option as the output
is a stream, so we need to be able to send results to the output queue
as soon as they are found, and avoid sending any duplicated results if
a worker is restarted. The order of the results is not important, just
that they all arrive eventually.

Cheers,
Andrew


More information about the rabbitmq-discuss mailing list