How long RabbitMQ keeps the messages for disconnected consumers?

Let's say that a consumer for a queue has been disconnected for some time during which many number of messages are produced.

  • How long does RabbitMQ keep the messages for the disconnected consumer without durable mode? (Will it discard the queue right after the consumer is disconnected? or will it keep the queue until the memory allows?)

  • Does the durable mode will give a functionality for a consumer to consume any message which is published until now? (ie random access to the queue, fetching messages out-of-order, or consuming from the beginning of the queue)


  • There are some TTL extensions.
  • TTL can be set for a given queue by setting the x-message-ttl argument to queue.declare, or by setting the message-ttl policy.

  • No it doesn't. The messages are kept in queue until they are acknowledged, regardless of durability. (unless of course the server dies, then the messages are gone if not previously marked as durable).
  • 链接地址: http://www.djcxy.com/p/59242.html

    上一篇: RabbitMQ:当没有消费者连接时丢弃消息

    下一篇: RabbitMQ为断开连接的消费者保存消息多久?