-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunDemo.sh
executable file
·50 lines (37 loc) · 1.1 KB
/
runDemo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
echo "Building the demo"
go build
echo "Running the server in background"
./boltDemo -db data/demo.db -e &
sleep 1
echo "listing queues (none should be present)"
curl "http://localhost:9999/queues"
echo
echo "creating two queues"
curl -X POST "http://localhost:9999/queue/q1"
curl -X POST "http://localhost:9999/queue/q2"
echo
echo "listing queues (should be two now)"
curl "http://localhost:9999/queues"
echo
echo "sending two messages to queue q1"
curl -X POST --data message=hello1 "http://localhost:9999/queue/q1/messages"
curl -X POST --data message=hello2 "http://localhost:9999/queue/q1/messages"
echo
echo "receiving the messages"
curl "http://localhost:9999/queue/q1/messages"
echo
echo "sending one more message"
curl -X POST --data message=hello3 "http://localhost:9999/queue/q1/messages"
echo
echo "listing the queues to show the stats"
curl "http://localhost:9999/queues"
echo
echo "deleting queue q1"
curl -X DELETE "http://localhost:9999/queue/q1"
echo
echo "listing queues (should now only be q2)"
curl "http://localhost:9999/queues"
echo
echo "killing the server"
pkill -f boltDemo