This repository contains a RabbitMQ prototype setup with Docker Compose, consisting of a producer and a consumer for testing and demonstrating possible scenario.
The goal of this project is to create a system that collects and processes Wikipedia edit events, calculates the global number of edits per minute, and also tracks the number of edits for the German Wikipedia per minute. The system uses RabbitMQ as the message broker to handle the message passing between the producer and consumer.
-
Clone the repository to your local machine.
-
Install Docker Desktop and make sure it's running.
-
Open the project folder in Visual Studio Code (optional but recommended).
The repository has the following files:
-
docker-compose.yml: The Docker Compose configuration file that defines the RabbitMQ server, producer, and consumer services. -
Dockerfile_producerandDockerfile_consumer: Dockerfiles for building the Docker images for the producer and consumer scripts. -
producer.py: The Python script acting as the producer, emitting sample data to the RabbitMQ queue. -
consumer.py: The Python script acting as the consumer, reading data from the RabbitMQ queue and performing aggregations.
-
Open the terminal in Visual Studio Code or any terminal/command prompt in the project folder.
-
Run the following command to build the Docker images and start the containers:
docker-compose up --build
This command will start the RabbitMQ server and the producer and consumer containers, and you'll see the logs in the terminal.
To stop the containers, press 'Ctrl+C' in the terminal where the Docker Compose is running.
To remove the Docker containers and images created by Docker Compose, run the following command:
docker-compose down