Homework 4
Assignment
Messaging in Docker images
- Donwload the project code from git. hps://github.com/UsamaAshraf/microservices-using-rabbitmq
- Unzip to get the file.
- Launch The Microservices.
$ docker-compose up
- Check for 3 services.
$ docker ps
- Open two new terminals, SSH into the Python and Go containers using the respecve container names and start the servers:
docker exec -it microservicesusingrabbitmq_python-service_1 bash FLASK_APP=main.py python -m flask run — port 3000 — host 0.0.0.0
docker exec -it microservicesusingrabbitmq_go-service_1 bash go run main.go
- Open a third terminal to send the POST request:
Lost code
- MQ performance Test。
Run a script.
#/bin/sh
sum=1000000000
i=0 while [ "$i" -le "$sum" ]
do
curl -d "full_name=$i" -X POST http://localhost:3000/users/1 i=$(($i+1))
done