0
0
RabbitMQdevops~20 mins

Consumer acknowledgment strategies in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
RabbitMQ Consumer Acknowledgment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding manual acknowledgment in RabbitMQ

In RabbitMQ, what happens when a consumer uses manual acknowledgments but fails to send an acknowledgment for a received message?

AThe message is automatically acknowledged after a timeout period.
BThe message is duplicated and sent to all other consumers immediately.
CThe message remains unacknowledged and will be requeued when the consumer disconnects.
DThe message is lost and removed from the queue permanently.
Attempts:
2 left
💡 Hint

Think about what RabbitMQ does to ensure messages are not lost if a consumer crashes.

💻 Command Output
intermediate
2:00remaining
Output of RabbitMQ consumer with auto-ack enabled

What is the output behavior when a RabbitMQ consumer is started with autoAck=true and the consumer crashes before processing the message?

RabbitMQ
channel.basicConsume(queueName, true, consumer);
AThe message is duplicated and sent to all consumers.
BThe message is requeued and delivered to another consumer.
CThe message is held until the consumer recovers and processes it.
DThe message is lost because it was auto-acknowledged immediately.
Attempts:
2 left
💡 Hint

Auto-ack means the message is acknowledged as soon as it is delivered.

🔀 Workflow
advanced
3:00remaining
Correct sequence for manual acknowledgment in RabbitMQ consumer

Arrange the steps in the correct order for a RabbitMQ consumer using manual acknowledgments to process a message safely.

A1,4,2,3
B1,2,3,4
C2,1,3,4
D1,3,2,4
Attempts:
2 left
💡 Hint

Acknowledge only after successful processing.

Troubleshoot
advanced
2:30remaining
Identifying cause of message duplication in RabbitMQ

A RabbitMQ consumer using manual acknowledgments notices duplicate messages being processed. Which of the following is the most likely cause?

AThe consumer is not acknowledging messages, causing RabbitMQ to requeue them after disconnect.
BThe consumer is acknowledging messages before processing them.
CThe queue is configured with <code>autoDelete=true</code>.
DThe consumer is using <code>autoAck=true</code>.
Attempts:
2 left
💡 Hint

Think about what happens if messages are not acknowledged.

Best Practice
expert
3:00remaining
Best practice for ensuring message processing reliability in RabbitMQ

Which consumer acknowledgment strategy best ensures that messages are processed exactly once, even if the consumer crashes during processing?

AUse manual acknowledgments and acknowledge messages only after successful processing.
BUse <code>autoAck=true</code> to acknowledge messages immediately upon receipt.
CUse manual acknowledgments but acknowledge messages before processing starts.
DDisable acknowledgments and rely on queue durability.
Attempts:
2 left
💡 Hint

Consider when to send acknowledgment to avoid message loss or duplication.