Skip to content
Star
478
Star
478

RabbitMQ

This guide shows you how to work with RabbitMQ locally using Docker Compose and Python. This lab demonstrates real-time event publishing and consumption using the pika client.

  1. Setup Environment:

    Open VS Code in the project folder and execute this command in the Command Palette:

    Terminal window
    > Dev Containers: Reopen in Container
  2. Start Infrastructure: Launch the RabbitMQ container:

    Terminal window
    docker compose up -d
  3. Run the Example:

    1. Publish events (Terminal 1):
      Terminal window
      python publish.py
    2. Listen for events (new terminal):
      Terminal window
      python listen.py

Open the RabbitMQ Management UI and navigate to Queues to inspect the user_events queue (credentials from .env):

Terminal window
http://localhost:15672
Terminal window
docker compose down -v