

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Nodes and Clusters
incomplete
2: Backpressure
incomplete
3: Healthy Queues Are Empty
incomplete
4: Prefetch
incomplete
5: Quorum Queues
incomplete
This lesson's interactive features are locked, please to keep using them
When you run a consumer, you may have assumed this process for message consumption:
But that would slow everything down to a crawl due to the full network round trip for every message. Instead, RabbitMQ allows you to prefetch messages. When you prefetch messages, RabbitMQ will send you a batch of messages at once, the client library will store them in memory, and you can process them one by one. Much faster. The diagram shows 3 consumers each prefetching batches of 2.
Without a limit, one client can prefetch all 10,000 messages from the server, and other clients can't get any messages until it has processed them. That's why we set prefetch(1) earlier, but a prefetch of 1 pays a full network round trip for every message.
This will ensure that each client only prefetches 10 messages at a time. This will allow other clients to get messages while one client is processing.
Run and submit the CLI tests with an empty game_logs queue.