Recall & Review
beginner
What is the purpose of 'prefetch' in RabbitMQ?
Prefetch limits the number of unacknowledged messages a consumer can hold. It helps distribute messages fairly among consumers by preventing one from getting overloaded.
Click to reveal answer
beginner
How does fair dispatch improve message processing in RabbitMQ?
Fair dispatch ensures that messages are distributed evenly among consumers based on their ability to process them, avoiding one consumer from receiving too many messages at once.
Click to reveal answer
intermediate
Which RabbitMQ method sets the prefetch count for a consumer?
The method is
channel.basicQos(prefetchCount), where prefetchCount is the max number of unacknowledged messages allowed.Click to reveal answer
beginner
What happens if prefetch is set to 1 in RabbitMQ?
Each consumer receives only one message at a time and must acknowledge it before getting another. This ensures strict fair dispatch.
Click to reveal answer
intermediate
Why is manual message acknowledgment important with fair dispatch?
Manual acknowledgment lets RabbitMQ know when a message is processed. Without it, messages might be lost or unfairly distributed.
Click to reveal answer
What does setting prefetch count to 1 do in RabbitMQ?
✗ Incorrect
Setting prefetch to 1 ensures each consumer processes one message at a time before receiving another.
Which method is used to set the prefetch count in RabbitMQ?
✗ Incorrect
The correct method is channel.basicQos(prefetchCount) to control message flow.
Why is fair dispatch important in RabbitMQ?
✗ Incorrect
Fair dispatch balances load by giving consumers messages they can handle.
What happens if a consumer does not acknowledge a message in RabbitMQ with prefetch set?
✗ Incorrect
RabbitMQ waits for acknowledgment before sending more messages to that consumer.
Which of these is NOT a benefit of using prefetch with fair dispatch?
✗ Incorrect
Prefetch controls message flow but does not handle automatic retries.
Explain how prefetch and manual acknowledgments work together to achieve fair dispatch in RabbitMQ.
Think about how RabbitMQ knows when to send the next message.
You got /4 concepts.
Describe the effect of setting prefetch count to 1 on message processing and consumer load.
Imagine a worker who can only handle one task before getting another.
You got /4 concepts.