0
0
RabbitMQdevops~20 mins

Message TTL (Time To Live) in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Message TTL Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
What is the output of this RabbitMQ queue declaration with TTL?
You declare a queue with the following command. What will be the TTL (in milliseconds) for messages in this queue?
RabbitMQ
rabbitmqadmin declare queue name=myqueue arguments={"x-message-ttl":60000}
A60000
B6000
C0
D3600000
Attempts:
2 left
💡 Hint
TTL is set in milliseconds in the x-message-ttl argument.
🧠 Conceptual
intermediate
1:30remaining
What happens to a message when its TTL expires in RabbitMQ?
In RabbitMQ, if a message's TTL expires while it is still in the queue, what is the expected behavior?
AThe message is delivered immediately regardless of TTL.
BThe message is discarded or dead-lettered if configured.
CThe message TTL resets and the message stays in the queue indefinitely.
DThe queue deletes itself automatically.
Attempts:
2 left
💡 Hint
TTL means the message should not live beyond a certain time in the queue.
Configuration
advanced
2:00remaining
Which queue declaration sets a message TTL of 30 seconds and dead-letters expired messages to 'dlx' exchange?
Choose the correct RabbitMQ queue declaration command that sets a 30-second message TTL and routes expired messages to a dead-letter exchange named 'dlx'.
Arabbitmqadmin declare queue name=task_queue arguments={"x-message-ttl":30000,"x-dead-letter-exchange":"dlx"}
Brabbitmqadmin declare queue name=task_queue arguments={"x-message-ttl":30000,"x-dead-letter-exchange":""}
Crabbitmqadmin declare queue name=task_queue arguments={"x-message-ttl":3000,"x-dead-letter-exchange":"dlx"}
D}"xld":"egnahcxe-rettel-daed-x",00003:"ltt-egassem-x"{=stnemugra eueuq_ksat=eman eueuq eralced nimdaqmtibbar
Attempts:
2 left
💡 Hint
TTL is in milliseconds and dead-letter exchange name must be a string.
Troubleshoot
advanced
2:00remaining
Why are expired messages not removed from a RabbitMQ queue with TTL set?
You set a message TTL on a queue, but expired messages remain in the queue indefinitely. What is the most likely cause?
ARabbitMQ does not support message TTL on queues.
BThe TTL value was set too high, so messages have not expired yet.
CThe queue has no consumers, so expired messages are not removed automatically.
DThe messages were published with a per-message TTL overriding the queue TTL.
Attempts:
2 left
💡 Hint
Expired messages are removed during queue operations like delivery or purge.
🔀 Workflow
expert
3:00remaining
Order the steps to configure and verify message TTL with dead-lettering in RabbitMQ.
Put these steps in the correct order to set up a queue with message TTL and dead-letter exchange, then verify expired messages are dead-lettered.
A3,1,2,4
B2,1,3,4
C1,3,2,4
D1,2,3,4
Attempts:
2 left
💡 Hint
You must create the dead-letter exchange before referencing it in the queue.