This Python-based system demonstrates the use of RabbitMQ for handling SMS message queues, with multi-threading to simulate multiple message sender instances.
The system is composed of three main parts:
- Producer: Generates random SMS messages along with phone numbers and enqueues them into RabbitMQ.
- Sender: Multiple sender instances, which can be run concurrently, dequeuing messages and simulating the message sending process.
- Progress Monitor: Monitors the progress of message sending, reporting on both successful and failed attempts.
- Python 3.6 or higher
- RabbitMQ server
- Pika Python library
First, make sure RabbitMQ is installed on your system. You can download it from the official RabbitMQ website.
Once RabbitMQ is installed and running, install the required Python packages:
pip install pika
- Clone this repository or download the source code.
- Open a terminal or command prompt.
- Navigate to the project directory.
- Execute the
main.py
script with optional arguments for configuration:python main.py --num_senders 5 --num_messages 1000
The application can be configured using the following command-line arguments:
--num_senders: Number of sender instances (default is 1). --num_messages: Number of SMS messages to generate (default is 1000).
To monitor the RabbitMQ server and the message queue, you can use the RabbitMQ Management Plugin. By default, it can be accessed at http://localhost:15672/. The default login is "guest" for both the username and password.
Navigate to the "Queues" section to see details about the message queues, including the number of enqueued messages.
Here is a screenshot of my project: