[rabbitmq-discuss] Reordering messages

David Wragg david at rabbitmq.com
Fri Jan 21 13:43:50 GMT 2011


Dimitri del Marmol <tontondimsum at gmail.com> writes:
> I am facing the following problem: I have to process messages from a
> queue but messages can be of either high or low priority.
> Messages have to be processed FIFO except that all high priority
> messages must be processed before the oldest low priority message is
> processed.
>
> The 'dumb' solution would be to reorder the list before processing
> each message. I could do that by acking all the messages and reposting
> them to the queue in the right order I guess...
>
> Is there an established pattern for this?

Put the two categories of messages onto two separate queues, and write
your application to preferentially consume from the higher priority
queue.

David

-- 
David Wragg
Staff Engineer, RabbitMQ
SpringSource, a division of VMware


More information about the rabbitmq-discuss mailing list