Skip to content

Instantly share code, notes, and snippets.

@blasterpal
Created August 19, 2015 16:30
Show Gist options
  • Select an option

  • Save blasterpal/79603af49bfe45acc21c to your computer and use it in GitHub Desktop.

Select an option

Save blasterpal/79603af49bfe45acc21c to your computer and use it in GitHub Desktop.
Create RabbitQ queue, exchange and bind to routing key w/ Curl.
# create queue
# /api/queues/vhost/name
curl -i -u $AMQP_USER:$AMQP_PASSWORD -H "content-type:application/json" \
-XPUT -d'{"auto_delete":false,"durable":true,"arguments":[]}' \
"http://$AMQP_HOST:$RABBIT_MGT_PORT/api/queues/%2F/$SCHEDULER_TRIGGER_QUEUE"
# create exchange
# PUT /api/exchanges/vhost/name
curl -i -u $AMQP_USER:$AMQP_PASSWORD -H "content-type:application/json" \
-XPUT -d'{"type":"direct","auto_delete":false,"durable":true,"arguments":[]}' \
"http://$AMQP_HOST:$RABBIT_MGT_PORT/api/exchanges/%2F/$AMQP_EXCHANGE"
# bind queue and routing
# /api/bindings/vhost/queue/exchange
# /api/bindings/vhost/e/exchange/q/queue
curl -i -u guest:guest -H "content-type:application/json" \
-XPOST -d "{\"routing_key\":\"$SCHEDULER_TRIGGER_QUEUE\"}" \
"http://$AMQP_HOST:$RABBIT_MGT_PORT/api/bindings/%2F/e/$AMQP_EXCHANGE/q/$SCHEDULER_TRIGGER_QUEUE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment