0
0
RabbitMQdevops~5 mins

Fair dispatch with prefetch in RabbitMQ - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
ALimits each consumer to one unacknowledged message at a time
BAllows unlimited messages to be sent to consumers
CDisables message acknowledgments
DSends messages to only one consumer
Which method is used to set the prefetch count in RabbitMQ?
Achannel.setPrefetch(prefetchCount)
Bchannel.setQos(prefetchCount)
Cchannel.prefetchCount(prefetchCount)
Dchannel.basicQos(prefetchCount)
Why is fair dispatch important in RabbitMQ?
ATo evenly distribute messages based on consumer capacity
BTo send all messages to the fastest consumer
CTo disable message acknowledgments
DTo increase message size
What happens if a consumer does not acknowledge a message in RabbitMQ with prefetch set?
ARabbitMQ sends more messages regardless
BRabbitMQ will not send more messages to that consumer until acknowledgment
CThe message is deleted immediately
DThe consumer is disconnected
Which of these is NOT a benefit of using prefetch with fair dispatch?
APrevents consumer overload
BEnsures even message distribution
CAutomatically retries failed messages
DImproves processing efficiency
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.