-
Start RabbitMQ server from the docker-compose repo:
git clone https://github.com/DistCodeP7/docker-compose.git docker-compose cd docker-compose docker-compose up -d -
Run go application with the database URL environment variable:
DB_URL="..." go run main.go -
Test the message queue using Python:
cd python_testing
python3 -m venv venv
source venv/bin/activate
pip install pika
python producer.pycd python_testing
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install pika
python producer.py- Run go application with the database URL environment variable:
DB_URL="..." go run main.go-
Run tests:
go test ./...
In order to test the worker you can publish some code messages to the RabbitMQ queue using the provided Python script. Make sure you have Python and the pika library installed.
-
Setup venv and install dependencies: From the python_testing directory run:
python3 -m venv venv source venv/bin/activate pip install pika -
Run the script to monitor messages:
python consumer.py
-
Run the script to publish messages:
python producer.py