0
0
RabbitMQdevops~20 mins

Publisher confirms in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Publisher Confirms Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What does enabling publisher confirms in RabbitMQ do?

When a publisher enables publisher confirms in RabbitMQ, what is the main effect?

AMessages are encrypted end-to-end between publisher and consumer.
BThe publisher receives acknowledgments from the broker when messages are successfully handled.
CThe broker automatically retries sending messages if the consumer is slow.
DThe publisher can send messages without waiting for any confirmation.
Attempts:
2 left
💡 Hint

Think about how the publisher knows if the broker accepted the message.

💻 Command Output
intermediate
2:00remaining
What is the output when a publisher confirms channel is enabled in RabbitMQ CLI?

After enabling publisher confirms on a channel using RabbitMQ client, what output or state change should you expect?

RabbitMQ
channel.confirmSelect();
System.out.println(channel.waitForConfirms() ? "Confirmed" : "Not Confirmed");
AConfirmed
BNot Confirmed
CSyntaxError
DTimeoutException
Attempts:
2 left
💡 Hint

Assuming the broker accepted the message, what does waitForConfirms() return?

Troubleshoot
advanced
2:00remaining
Why does waitForConfirms() throw TimeoutException in RabbitMQ?

When using publisher confirms, the method waitForConfirms() sometimes throws a TimeoutException. What is the most likely cause?

AThe message payload is too large for the broker to process.
BThe consumer has not acknowledged the message yet.
CThe publisher did not enable confirm mode on the channel.
DThe broker did not send an acknowledgment within the expected time.
Attempts:
2 left
💡 Hint

Consider what happens if the broker is slow or unresponsive.

🔀 Workflow
advanced
3:00remaining
Correct order of steps to use publisher confirms in RabbitMQ

Put the following steps in the correct order to properly use publisher confirms in RabbitMQ.

A1,3,2,4
B2,1,3,4
C1,2,3,4
D2,3,1,4
Attempts:
2 left
💡 Hint

Think about enabling confirm mode before publishing, then waiting for confirmation.

Best Practice
expert
3:00remaining
Best practice to handle negative acknowledgments (nacks) with publisher confirms

When using publisher confirms, what is the best practice to handle messages that receive a negative acknowledgment (nack) from the broker?

ALog the nack and retry publishing the message after a delay.
BIgnore the nack and assume the message was delivered.
CImmediately close the channel and stop publishing messages.
DDelete the message from the queue to prevent duplicates.
Attempts:
2 left
💡 Hint

Consider how to ensure message delivery reliability after a nack.