[rabbitmq-discuss] Fwd: Message expiry in topics

Matthias Radestock matthias at lshift.net
Thu Jul 5 15:36:34 BST 2007


Ben,

"Ben Hood" <0x6e6562 at gmail.com> writes:

>> RabbitMQ treats 'expiration' as an opaque field - we pass it along but
>> don't do anything with it.
>
> The scenario where I was thinking about this has been covered by the
> other post, because I was imagining a topic with many readers that
> each get each message delivered to them once. So for example with a
> price feed, you set up a queue per consumer and the queue could
> persumeably be cleaned up when the consumer dies. You would not need
> to have messages expire or manually purge the queue, if the cleanup
> were automatic. Does this work with rabbitmq?

Yes, as required by the spec, auto-delete queues are deleted when the
consumer disappears, and any messages they held at the time are
purged. There is one exception: in our current implementation persistent
messages that are present at queue deletion time are not removed from
the persistent store. We will implement that in a future release.

> Also, if you publish to an exchange with a routing key for which there
> is no bound queue, then what happens to those messages (this is a
> scenario where there is a producer but no interested consumers)?

That depends on the settings of the 'mandatory' flag in basic.publish.
<quote>
      This flag tells the server how to react if the message cannot be
      routed to a queue.  If this flag is set, the server will return an
      unroutable message with a Return method.  If this flag is zero, the
      server silently drops the message.
</quote>


Regards,

Matthias.




More information about the rabbitmq-discuss mailing list