消费者的 RabbitMQ 队列超时

RabbitMQ queue timeout with a consumer

我正在寻找一种使队列过期的方法,即使有活跃的消费者正在收听。从这个网站 https://www.rabbitmq.com/ttl.html 它说

Unused means the queue has no consumers, the queue has not been redeclared, and basic.get has not been invoked for a duration of at least the expiration period.

我想要所有这些东西,但我希望队列消失,即使有消费者在听。这可能吗?

Is that possible?

不直接在 RabbitMQ 中。

只要消费者连接到队列并侦听消息,队列就会保持活动状态。

不过,您可以让一些代码在一段时间后删除队列。那将是你唯一的选择。