Work Queues (Task Distribution) — Concept Check
Questions on Work Queues (Task Distribution). Multiple workers consume from a single queue; with prefetch=1 and manual ack, work is evenly distributed to idle workers rather than buffered on a busy one.
Questions in this quiz
8 questions on Work Queues (Task Distribution) — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A work queue system with prefetch=1 is experiencing delays. What might be the cause?
- AThe queue is not durable.
- BWorkers are slow to acknowledge tasks.
- CMessages are not persistent.
- DTasks are not being requeued on failure.
2.In a task queue with prefetch=1, what happens if a worker fails to acknowledge a task?
- AThe task is requeued for another worker.
- BThe queue stops processing further tasks.
- CThe task is sent to a dead-letter queue.
- DThe task is permanently lost.
3.What is the advantage of setting prefetch=1 in a work queue system?
- AEnsures tasks are evenly distributed among workers.
- BAllows workers to process multiple tasks simultaneously.
- CReduces the need for manual acknowledgments.
- DIncreases the speed of task processing.
4.A developer notices that one worker is idle while another is overloaded. What setting might be missing?
- AManual ack is not enabled.
- BPrefetch=1 is not set.
- CThe queue is not durable.
- DMessages are not persistent.
5.What happens if prefetch is not set in a RabbitMQ work queue?
- ATasks are distributed in a round-robin fashion.
- BTasks are processed in parallel by all workers.
- CTasks are lost if a worker fails.
- DTasks are evenly distributed among workers.
6.Why might someone incorrectly believe a task is lost if a worker fails to process it?
- AThey assume tasks are not requeued without manual ack.
- BThey assume the queue is not durable.
- CThey think tasks are deleted immediately after failure.
- DThey believe prefetch=1 prevents requeuing.
7.In a Spring AMQP setup, how is fair dispatch achieved?
- ABy deploying multiple pods without concurrency settings.
- BBy setting prefetch=1 in application.yml.
- CBy using automatic acknowledgment mode.
- DBy setting the queue as non-durable.
8.A system with a durable queue and persistent messages loses tasks after a broker restart. What might be wrong?
- APrefetch=1 is not set.
- BManual ack is not used.
- CThe queue is not durable.
- DMessages are not persistent.