Prefetch Count & QoS — Concept Check
Questions on Prefetch Count & QoS. basicQos limits the number of unacknowledged messages a consumer can hold; low prefetch ensures even work distribution and prevents a slow consumer from monopolising the queue.
Questions in this quiz
7 questions on Prefetch Count & QoS — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A consumer in a RabbitMQ setup is processing long tasks, each taking over 1 second. What prefetch value should be set for fairness?
- A10
- B100
- C5
- D1
2.In a RabbitMQ system, one consumer processes messages much faster than others. What might be happening if prefetch is not set?
- AThe slow consumers receive more messages.
- BMessages are evenly distributed regardless of speed.
- CAll consumers process evenly.
- DThe fast consumer monopolizes the queue.
3.What happens when the unacked counter reaches the prefetchCount in RabbitMQ?
- AThe broker stops delivering messages until an ack is received.
- BMessages are delivered faster to the consumer.
- CThe broker starts delivering to another channel.
- DThe channel is closed automatically.
4.A developer sets `prefetchCount = 10` for short tasks in RabbitMQ. What is the likely outcome?
- AConsumers will become idle.
- BDecreased throughput with more fairness.
- CMessages will be lost.
- DIncreased throughput with less fairness.
5.In Spring AMQP, what is the default prefetch value and its impact on slow tasks?
- A5; balances throughput and fairness.
- B10; optimal for all task lengths.
- C1; ensures fairness for slow tasks.
- D250; can cause imbalance with slow tasks.
6.A RabbitMQ consumer is idle while there are messages ready in the queue. What could be the issue?
- APrefetch is too low, causing the consumer to wait.
- BThe consumer is set to auto-acknowledge messages.
- CThe channel is closed, preventing message delivery.
- DPrefetch is too high, causing message loss.
7.Why might a developer set `global=true` for basicQos in RabbitMQ?
- ATo increase message delivery speed.
- BTo improve fairness among consumers.
- CTo ensure messages are acknowledged automatically.
- DTo apply the prefetch limit to the whole channel.