This project demonstrates the use of RabbitMQ for simulating email delivery to contacts stored in a MongoDB database.
Before you begin, ensure you have met the following requirements:
- Python 3 installed on your system.
- RabbitMQ server accessible with the required credentials.
- MongoDB server accessible with the required connection URI.
- Python packages listed in
requirements.txtinstalled.
-
Clone the repository:
- Clone this repository to your local machine.
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate # On Windows, use "venv\Scripts\activate"
-
Install the required packages:
pip install -r requirements.txt
-
Configure the application by creating a
config.pyfile with your RabbitMQ and MongoDB credentials. Use the provided template in the repository. -
Define your Contact model in the
models.pyfile as per your project requirements. -
Write your
producer.pyscript to generate contacts and send messages to RabbitMQ. Adjust the code according to your needs. -
Write your
consumer.pyscript to consume messages from RabbitMQ and process them. Customize the code as necessary. -
Run the producer and consumer scripts in separate terminal windows:
python producer.py
python consumer.py
-
Observe the messages being processed and contacts updated in the MongoDB database.
To contribute to this project, follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b feature/your-feature. - Make your changes and commit them:
git commit -m 'Add some feature'. - Push to the original branch:
git push origin feature/your-feature. - Create a pull request.