Skip to content
Exercise · RabbitMQ consumers · lesson 3 of 8

Exercise: workers with prefetch

A service works through a RabbitMQ task queue with several workers at once. Without prefetch the broker hands the whole queue to the consumer, and the tasks sit in the consumer's memory while only a few workers are busy with them and other consumers stand idle. The broker in this exercise is a model in the tests file, not a real RabbitMQ: a quorum queue and an AMQP channel with one consumer.