We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Backpressure

Backpressure is a common problem in Pub/Sub systems. It happens when messages are being published to a queue faster than they can be consumed. This leads to a growing queue size, which can eventually cause the system to run out of memory or disk space.

Assignment

Let's add a feature to spam absurd amounts of game logs... for science. We'll use this feature to demonstrate backpressure.

Because our game_logs queue is listening for messages with the routing key game_logs.*, the server will receive messages from all players.

Run and submit the CLI tests while the queue has thousands of messages!

In the next lesson, we'll empty the queue.

Troubleshooting

If messages_ready is set to 0, try any of the following:

  • Stop the server so that messages are not consumed.
  • Restart the rabbitmq container. Make sure the peril_direct and peril_topic exchanges are there (they should be if you use rabbit.sh) and restart the server to create the game_logs queue.