This is an implementation of a Redis Queue using a trigger that sends the message to a producer which stores the message in the redis queue and then a consumer checks for new messages on it.
If a new message is in the queue, the consumer process it and sends it to the ending API.
- Python >= 3
- pip >= 19.2.3
- Docker >= 19.03.12
- Docker Compose >= 1.24.0
- Redis: 6379
- Producer: 11000
- Ending API: 12000
- Producer
- Redis
- Consumer
- Ending API
# Build the containers
docker-compose build
# Run the containers
docker-compose up
# Install trigger.py dependencies
pip install -r requirements.txt
# Send the message
python trigger.py
Inside the docker-compose.yml:
-
Change the environment variable: ENDING_API (Ex: name-of-your-container:port)
-
Change the depends_on with the name of your container (Ex: name-of-your-container)