This project demonstrates how a priority queue can be used to schedule and process jobs using RabbitMQ and Python. It visualizes how jobs are enqueued with different priorities and how a worker processes them in priority order.
- Jobs are labeled
job1
throughjob15
and assigned a random priority between 0 (highest) and 5 (lowest). - The sender script enqueues jobs into a RabbitMQ priority queue, printing each job and its priority as it is added.
- The receiver script consumes the jobs in priority order and stops automatically after processing all jobs.
Ensure the following tools are installed:
- Docker
- Python 3.x
venv
module (usually comes with Python)
To run everything in one go, simply run the provided Bash script:
./priority_q_vis.sh
For a more realistic visualization, see scripts
.