- WSL (Ubuntu): Install via Windows Features or Microsoft Store
- Docker: For running RabbitMQ
- Python 3.10+: With pip and venv
- Git: For cloning and version control
-
WSL (Ubuntu): Required for running Celery and Supervisor
Install from Microsoft Store or enable via Windows Features:- Open PowerShell (as Administrator):
wsl --install - Restart your computer if needed
- Open Ubuntu and finish setup
- Open PowerShell (as Administrator):
-
Docker Desktop: Required for running RabbitMQ
- Download and install from: https://www.docker.com/products/docker-desktop
- Enable WSL 2 backend and ensure Docker is available in Ubuntu by running:
docker --version
-
Python 3.10+ (in WSL Ubuntu)
Use Ubuntu terminal, not Windows command prompt:sudo apt update sudo apt install python3 python3-pip python3-venv -y
git clone https://github.com/your-username/async-worker-prototype.git
cd async-worker-prototype
sudo apt install supervisorpython3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtsudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker $USER
Log out and back in to apply Docker group changes.
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
docker psAccess the management UI at http://localhost:15672 Username: guest, Password: guest
Configure Supervisor Ensure supervisord.conf is in the project / directory.
Create log files:
touch src/supervisord.log src/celery.out.log src/celery.err.log
chmod -R 755 src
chown -R $USER:$USER srcsudo supervisord -c src/supervisord.conf
sudo supervisorctl -c src/supervisord.conf statusExpected output: celery_worker RUNNING
python src/sender.py
tail -f src/celery.out.log
tail -f src/celery.err.log
sudo supervisorctl -c src/supervisord.conf shutdown
Testing Manual Testing: Use sender.py to send sample JSON messages and verify logs
Validation: Ensure the worker handles invalid payloads with retries
Concurrency: Test with concurrency=2 in supervisord.conf