RabbitMQ Streams Queue is not deleted - x-max-age: | 60s #4384
-
RabbitMQ Streams Queue is not deleted after set x-max-age: | 60s |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Streams are the fundamental opposite to queues in terms of how they store data. Queues move towards the empty state where streams move towards the full state. In our implementation a stream will never be completely empty as we always keep the newest segment on disk. For efficiency we never rewrite the segment data so if the segment is large you may have data in there that is well outside of your time based retention specification. This shouldn't be a problem as if you're not interested in reading those messages you just use a time based consumer specification that excludes anything that is too old. If disk use is an issue you can specify a smaller segments size which means the retention specification will be applied more often. Having many smaller segments can have some overhead however so streams will never use a smaller segment size than 64KB even if you ask it to. So given the fundamental differences if getting rid of data is a requirement queues are much better at that. :) |
Beta Was this translation helpful? Give feedback.
x-max-age
doesn't specify when to delete the Stream but rather how long to keep the data in it for. Moreover, retention is only evaluated when a new segment file is created on disk for a given stream - if you publish a few messages and then stop publishing - they will never get deleted, you need to keep publishing to "push out" the old messages from the stream.More info: https://www.rabbitmq.com/streams.html#retention