Imagine a RabbitMQ consumer receives a message but crashes before sending an acknowledgment. What will RabbitMQ do with that message?
Think about how RabbitMQ ensures messages are not lost when consumers fail.
RabbitMQ waits for an explicit acknowledgment from the consumer. If the consumer crashes before acknowledging, RabbitMQ will requeue the message and deliver it to another consumer once the connection closes.
Given the following log lines from a RabbitMQ consumer process:
2024-06-01 10:00:00 Consumer connected to queue 'task_queue' 2024-06-01 10:00:05 Received message: 'Process data' 2024-06-01 10:00:06 Consumer crashed unexpectedly 2024-06-01 10:00:07 Message requeued for delivery
What does the last line indicate?
Look for the meaning of 'requeued' in message queues.
'Message requeued for delivery' means the message was not lost but placed back into the queue to be delivered again.
Choose the correct consumer configuration snippet that guarantees message acknowledgment is manual and messages are requeued on failure.
Consider how automatic acknowledgment affects message safety.
Setting auto_ack=False means the consumer must explicitly acknowledge messages. If the consumer crashes before acknowledgment, RabbitMQ will requeue the message.
You notice that the message count in a RabbitMQ queue keeps increasing despite consumers being connected. Which of the following is the most likely cause?
Think about what happens if messages are never acknowledged.
If consumers crash before acknowledging, messages remain unacknowledged and get requeued, causing the queue size to grow.
Put these RabbitMQ steps in the correct order when a consumer crashes before acknowledging a message.
Think about the natural sequence of events from message receipt to requeue.
The consumer first receives the message, then crashes before acknowledgment. RabbitMQ detects the closed connection and requeues the message.