x-expires does not delete the queue if it is not empty #10963
-
Is your feature request related to a problem? Please describe.For my application I wanted to delete unused queue after x minutes. Describe the solution you'd likeWould it be possible to add a 'non-empty-protection' option that would protect non-empty queues from being deleted by x-expires or by another option? Describe alternatives you've consideredFor my needs, I would need to launch a cron job that checks if the queue is empty and has been inactive for x amount of time. However, the benefits gained from this cleanup would be negated by this job. Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This has been discussed before -
It is unlikely this feature will be implemented unless requested by a customer who pays for RabbitMQ (via a support contract). |
Beta Was this translation helpful? Give feedback.
-
Even though RabbitMQ's implementation of queue TTL uses a fairly reasonable definition of when a queue is in use or has not been in used recently, TTL is a feature that means that data will be automatically deleted. If you are not OK with that, do not use TTL. Not only queues have multiple properties that control their lifecycle, they can be deleted programmatically by any app you want, using any condition you want. In fact, that's how 99.99% of queue deletions happen. "The queue is empty" is a highly volatile condition, it may be empty now and it is not in a millisecond. A much better — yet still not entirely surprise-free even then — approach would be to delete it after a certain period in the empty state. You are welcome to implement it or sponsor its development. Open source does not mean "free labor you can ask to solve your problem on GitHub." |
Beta Was this translation helpful? Give feedback.
Even though RabbitMQ's implementation of queue TTL uses a fairly reasonable definition of when a queue is in use or has not been in used recently, TTL is a feature that means that data will be automatically deleted. If you are not OK with that, do not use TTL.
Not only queues have multiple properties that control their lifecycle, they can be deleted programmatically by any app you want, using any condition you want. In fact, that's how 99.99% of queue deletions happen.
"The queue is empty" is a highly volatile condition, it may be empty now and it is not in a millisecond. A much better — yet still not entirely surprise-free even then — approach would be to delete it after a certain period…