Event-Driven Architecture implemented in Python with RabbitMQ and Docker. You have full access to the messages and service configurations. This project is based on Event-Driven Architecture in Python articles on Hashnode.
Follow these steps to run the project locally.
Use the following tutorials to make docker
and docker-compose
ready on your machine.
Open a fresh terminal tab and run the following commands.
git clone https://github.com/lnxpy/event-driven-in-python.git
cd event-driven-in-python
You can either create a virtual environement or do nothing in case of installing the required packages.
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
pip3 install -r requirements.txt
Make sure your Docker Daemon is working fine and your Docker service is running with the following command on Linux distributions.
sudo systemctl status docker
Then, start pulling the images and run a container on the background.
docker-compose up -d
Open settings/configs.py
file in a text editor and make changes. The default configuration might be fine for the rest of the project and your tests.
You can change the variable MESSAGE
from settings/configs.py
to make your own message pattern with some additional keys. Once you made your changes,
create two fresh terminal tabs and run both producer.py
and consumer.py
each by each. Since producet.py
declares the queue, make sure you run the producer module first. For more message fields, check out settings/volumes.py
. Make sure you use the exact key name as your message fields.
This project is made with the aim of educational purposes. Feel free to contribute.