[rabbitmq-discuss] Queue delete if-empty will delete the queue if there are in the unacked state
Matthias Radestock
matthias at rabbitmq.com
Wed Jan 2 04:53:34 GMT 2013
David,
On 02/01/13 00:14, David Barshow wrote:
> I think this may be a bug.
>
> Queues will delete when the if-empty bit is set to true when messages
> are in the unacknowledged state.
The AMQP spec is silent on this. The reason for choosing the current
behaviour is for consistency with the various operations that return
message-counts, such as queue.declare and basic.get. The spec mandates
that these counts do not include messages pending acknowledgement. And
indeed that kinda makes sense since it would be a bit odd to be told
that the queue has messages, issue a basic.get, and be told (by a
basic.get-empty response) that the queue is empty (since all the
messages were pending acknowledgement). Also, conceptually, messages
that are pending acknowledgement are not really in the queue anymore;
or, rather, there is nothing in AMQP that suggests, let alone mandates,
such a view.
Having said that, I can certainly see a case for "empty" to mean "no
ready messages and no messages pending acknowledgement". Alas I don't
know how we'd go about meeting such a requirement; I'd be reluctant to
change the semantics of something that has been around for five years,
particularly since we've had zero complaints to date about the current
semantics.
Regards,
Matthias.
More information about the rabbitmq-discuss
mailing list