-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest5P3C.sh
More file actions
23 lines (19 loc) · 1.16 KB
/
Copy pathtest5P3C.sh
File metadata and controls
23 lines (19 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
HOST=$1
PORT=$2
#creating topics
curl -XPOST "http://${HOST}:${PORT}/topics" -d '{"topic_name": "T1"}' -H "Content-Type: application/json"
curl -XPOST "http://${HOST}:${PORT}/topics" -d '{"topic_name": "T2"}' -H "Content-Type: application/json"
curl -XPOST "http://${HOST}:${PORT}/topics" -d '{"topic_name": "T3"}' -H "Content-Type: application/json"
#consumers
python runconsume.py --id 1 --topics T1 T2 T3 --broker ${HOST}:${PORT} --log_loc ./test/5P3C &
python runconsume.py --id 2 --topics T1 T3 --broker ${HOST}:${PORT} --log_loc ./test/5P3C &
python runconsume.py --id 3 --topics T1 T3 --broker ${HOST}:${PORT} --log_loc ./test/5P3C &
echo "3 consumers are started"
#producers
python runproduce.py --id 1 --topics T1 T2 T3 --broker ${HOST}:${PORT} --log_loc ./test/5P3C &
python runproduce.py --id 2 --topics T1 T3 --broker ${HOST}:${PORT} --log_loc ./test/5P3C &
python runproduce.py --id 3 --topics T1 --broker ${HOST}:${PORT} --log_loc ./test/5P3C &
python runproduce.py --id 4 --topics T2 --broker ${HOST}:${PORT} --log_loc ./test/5P3C &
python runproduce.py --id 5 --topics T2 --broker ${HOST}:${PORT} --log_loc ./test/5P3C &
echo "5 producers are started"
wait