Created
April 2, 2019 06:35
-
-
Save baybatu/36aef24681e751277ecc9f4efb53eb4e to your computer and use it in GitHub Desktop.
Create RabbitMQ queue and exchange with binding using REST API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create exchange | |
curl -i -u guest:guest -H "content-type:application/json" \ | |
-XPUT -d'{"type":"fanout","durable":true}' \ | |
http://localhost:15672/api/exchanges/%2f/my.exchange.name | |
# create queue | |
curl -i -u guest:guest -H "content-type:application/json" \ | |
-XPUT -d'{"durable":true,"arguments":{"x-dead-letter-exchange":"", "x-dead-letter-routing-key": "my.queue.dead-letter"}}' \ | |
http://localhost:15672/api/queues/%2f/my.queue | |
# create queue related dead letter queue | |
curl -i -u guest:guest -H "content-type:application/json" \ | |
-XPUT -d'{"durable":true,"arguments":{}}' \ | |
http://localhost:15672/api/queues/%2f/my.queue.dead-letter | |
# create binding | |
curl -i -u guest:guest -H "content-type:application/json" \ | |
-XPOST -d'{"routing_key":"","arguments":{}}' \ | |
http://localhost:15672/api/bindings/%2f/e/my.exchange/q/my.queue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment