[rabbitmq-discuss] Queue with message dropping
Matwey V. Kornilov
matwey.kornilov at gmail.com
Mon Jun 17 11:24:53 BST 2013
Let me imagine that I have a queue and an exchange bound with each
other. They implements pub/sub pattern, so the queue is private, only
one consumer consumes from the given queue.
Let every message be somehow marked in headers with a special tag. I
would like to get the following behaviour. If we have the message with
the tag "Tag1" in the queue, and It is not consumed yet, and if there is
new message with the tag "Tag1" coming from the exchange to the end of
the queue, then I want the first message with the tag "Tag1" be
unconditionally dropped from the queue and other messages left untouched.
The idea behind this is that I have a flow of events coming through the
broker, and consumers have to act somehow on the events receive. But
events may 'cancel' each other, and If I know that there is the most
recent event, then I don't want to pay attention to obsoleted and
unprocessed information, which may be still in message queue.
More information about the rabbitmq-discuss