py3.12 poetry
pipx install poetry
poetry --versionhttps://scoop.sh/ https://pipx.pypa.io/stable/installation/
Create lock file:
peotry lockInstall:
poetry install --no-rootSpin up the broker:
docker compose -f docker-compose.infrastructure.yaml up -dRun subscriber:
poetry run .\subscriber.pyPublish a message:
poetry run .\publisher.pyCheck the output in the subscriber:
[2025-05-18 17:58:38,591.591] [INFO] [subscriber.py:57]: Creating client: subscriber-local
[2025-05-18 17:58:38,591.591] [INFO] [subscriber.py:75]: Connecting to localhost:1883...
[2025-05-18 17:58:38,600.600] [INFO] [subscriber.py:15]: Connected with result code: Success
[2025-05-18 17:58:38,602.602] [INFO] [subscriber.py:43]: Subscribed with QoS: 1
[2025-05-18 17:58:41,802.802] [INFO] [subscriber.py:33]: some/cool/topic
[2025-05-18 17:58:41,802.802] [INFO] [subscriber.py:34]: b'{"hello": "world"}'
poetry run isort .
poetry run black .