Python

Write an awesome doc for Python. A very nice an practical one extracted from Python official documentation.

View on GitHub

Pubsub Pattern

Infographic of pubsub pattern

[!TIP]

You do not need to declare those queues upfront. We can use what’s known as temporary queues which will be deleted automatically once the connection is closed:

queue = channel.queue_declare('', exclusive=True)

How to Start This Example

  1. cd docs/rabbitmq.
  2. uv venv .venv.
  3. source .venv/bin/activate.
  4. uv install --requirements ./requirements.txt.
  5. Open 3 terminal sessions and cd to the same path
  6. Execute the following commands now:
    1. python src/pubsub/auditing-service.py.
    2. python src/pubsub/promotion-service.py.
    3. python src/pubsub/producer.py.