What happens to messages in a RabbitMQ queue when the queue has a TTL (time-to-live) set on messages?
Think about what TTL means for individual messages in a queue.
Message TTL means each message has a lifespan. If it is not consumed before the TTL expires, RabbitMQ removes it automatically.
Given a queue declared with x-expires set to 60000 (60 seconds), what happens if the queue is unused for 70 seconds?
rabbitmqctl list_queues name messages
# After 70 seconds of no consumers or messagesConsider what x-expires controls in RabbitMQ.
The x-expires argument sets the queue auto-expiry time. If the queue is unused (no consumers, no messages) for that time, RabbitMQ deletes it automatically.
Which of the following queue declarations correctly sets a message TTL of 30 seconds and auto-expiry of 2 minutes?
Remember TTL values are in milliseconds and x-message-ttl is for messages, x-expires is for queue expiry.
Option C correctly sets x-message-ttl to 30000 ms (30 seconds) and x-expires to 120000 ms (2 minutes). Other options swap or use wrong values.
You set x-message-ttl to 10000 (10 seconds) on a queue, but messages remain indefinitely. What is the most likely cause?
Consider how message TTLs interact with queue TTL settings.
Individual messages can have TTLs set when published. If these override the queue TTL, messages may live longer than expected.
Arrange the steps in the correct order to configure a RabbitMQ queue with message TTL and auto-expiry, then verify the settings.
Think about what must happen before publishing messages and verifying settings.
You must first declare the queue with TTL settings, then publish messages, verify the settings, and finally observe expiry behavior.