[rabbitmq-discuss] Per queue serialized delivery guarantee

Steve Powell steve at rabbitmq.com
Tue May 8 16:40:08 BST 2012


Hi Lucas,

If there are consumers listening to a queue with fewer messages
unacknowledged than their own pre-fetch count, then the broker will
deliver a message to one of those consumers (if there is one to
deliver).

It is not possible to tell RabbitMQ to limit total deliveries to many
consumers at once (though I suppose that might be useful).

You do not say when a message received by a consumer is acknowledged,
though if it is consistency you need I assume this happens only when the
message has been 'processed' in some way.

If there were one consumer per queue, the messages could be dispatched
from that consumer to workers (for processing) with acks sent only when
the required processing for each message is completed.

If you wish these other workers could be listening to their own queues,
though it might be tricky to load-balance dispatching based upon whether
they are busy or not.

> Maybe I was thinking with the wrong abstractions, and I could, inside
> the same queue, guarantee the serial delivery of the messages based on
> some logic attribute in the message header, like "no message with
> attribute X will be delivered if there is an unacknowledged message
> with this same attribute X". Is that possible?

You appear to want to select messages from a queue based upon some
criterion. I believe this is not possible. The only message you can
ever consume from a queue is the one at the front.

Steve Powell  (a happy bunny)
----------some more definitions from the SPD----------
chinchilla (n.) Cooling device for the lower jaw.
socialcast (n.) Someone to whom everyone is speaking but nobody likes.
literacy (n.) A textually transmitted disease usually contracted in childhood.

On 4 May 2012, at 19:40, Lucas Vella wrote:

> I have multiple queues and multiple consumers. To achieve load
> balancing, any consumer may consume from any queue, but for logic
> consistency in the system, no queue may deliver a message before
> receiving ack from the last message delivered from that queue. There
> may be a very large number of queues.
> 
> Is this scenario possible with RabbitMQ? I was working on the
> assumption that no message from a particular queue would be delivered
> if the was a pending unacknowledged message there, and a free consumer
> would pick a message from another queue, but that was not true for the
> tests I made, and serialization was only guaranteed if there was one
> consumer per queue. Also, the API did not provide any means for a
> consumer to read from "all available queues".
> 
> Maybe I was thinking with the wrong abstractions, and I could, inside
> the same queue, guarantee the serial delivery of the messages based on
> some logic attribute in the message header, like "no message with
> attribute X will be delivered if there is an unacknowledged message
> with this same attribute X". Is that possible?
> 
> What do you suggest?
> 
> --
> Lucas Clemente Vella
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss



More information about the rabbitmq-discuss mailing list