Skip to content

Instantly share code, notes, and snippets.

@wederbrand
Created July 4, 2018 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wederbrand/56792c2968fb74540a089e98cb9a15a7 to your computer and use it in GitHub Desktop.
Save wederbrand/56792c2968fb74540a089e98cb9a15a7 to your computer and use it in GitHub Desktop.
rabbit flow test
#!/bin/bash
# start rabbit
docker rm -f rabbit
date
docker run \
-d \
-p 15671:15671 \
-p 15672:15672 \
--hostname rabbit \
--name rabbit \
--cpus=0.1 \
rabbitmq:3.6.5-management
date
sleep 20
date
# create an exchange
curl -i -u guest:guest -H "content-type:application/json" \
-XPUT -d'{"type":"direct","durable":true}' \
http://localhost:15672/api/exchanges/%2f/myexchange
# creata a queue
curl -i -u guest:guest -H "content-type:application/json" \
-XPUT -d'{"durable":true}' \
http://localhost:15672/api/queues/%2f/myqueue
for i in $(seq 1 10000); do
# bind to that queue
curl -i -u guest:guest -H "content-type:application/json" \
-XPOST -d'{"routing_key":"dude.'$i'.#","arguments":{}}' \
http://localhost:15672/api/bindings/%2f/e/myexchange/q/myqueue
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment