Bird
0
0

You want to maximize throughput by batch publishing 1000 messages using publisher confirms in RabbitMQ. Which approach is best to ensure all messages are confirmed efficiently?

hard📝 Best Practice Q15 of 15
RabbitMQ - Performance Tuning
You want to maximize throughput by batch publishing 1000 messages using publisher confirms in RabbitMQ. Which approach is best to ensure all messages are confirmed efficiently?
APublish all 1000 messages, then wait for a single confirm after all are sent.
BPublish each message and wait synchronously for its confirm before sending the next.
CPublish messages in smaller batches (e.g., 100), waiting for confirms after each batch.
DDisable confirms and rely on transactions instead.
Step-by-Step Solution
Solution:
  1. Step 1: Understand publisher confirms behavior

    Waiting for each confirm synchronously slows throughput; waiting once after all risks large delays or failures unnoticed.
  2. Step 2: Choose balanced batch size approach

    Publishing in smaller batches with confirms balances throughput and reliability.
  3. Final Answer:

    Publish messages in smaller batches (e.g., 100), waiting for confirms after each batch. -> Option C
  4. Quick Check:

    Batch confirms balance speed and safety [OK]
Quick Trick: Use moderate batch sizes with confirms for best throughput [OK]
Common Mistakes:
MISTAKES
  • Waiting for each confirm slows throughput
  • Waiting once after all risks message loss
  • Disabling confirms loses reliability

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More RabbitMQ Quizzes