Messages on queue with message TTL occasionally do not expire #10719
-
Describe the bugMessages on queue with message TTL occasionally do not expire. When this happens a restart of the RabbitMQ server does not help. There are no consumers and the queue is defined with the following features and policy: x-dead-letter-exchange dead-letter-strategy: at-least-once Reproduction steps
The following image is showing the headers of the message at the head of the queue Expected behavior
Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is documented and has been discussed here on GitHub many times before. Messages expire when they reach the head of the queue and not earlier. Also see the section on retroactive application of a policy. Consumers will never receive expired messages as deliveries, though, so when exactly messages are marked for deletion does not matter for any queue that has consumers at least most of the time. Queues that do not have consumers for long time periods should be streams, where time-based expiration is the name of the game. |
Beta Was this translation helpful? Give feedback.
This is documented and has been discussed here on GitHub many times before.
Messages expire when they reach the head of the queue and not earlier. Also see the section on retroactive application of a policy.
Consumers will never receive expired messages as deliveries, though, so when exactly messages are marked for deletion does not matter for any queue that has consumers at least most of the time.
Queues that do not have consumers for long time periods should be streams, where time-based expiration is the name of the game.