Prefetch Count (QoS)
Configure the prefetch count (Quality of Service) to control how many messages a consumer receives at once. Optimize consumer efficiency and prevent individual consumers from being overwhelmed.
Control Message Flow with Prefetch
In a system with multiple consumers, how do you ensure messages are distributed fairly and no single consumer gets overwhelmed?
This lesson introduces the prefetch count, a crucial Quality of Service (QoS) setting in RabbitMQ.
The Challenge: Uneven Workload
By default, RabbitMQ dispatches messages in a round-robin fashion to available consumers. However, it doesn't wait for a consumer to finish processing a message before sending the next one.
If one consumer is slow, it might still receive many messages, while a fast consumer sits idle. This leads to an uneven workload.