Forked from baybatu/create-rabbitmq-exchange-queue-using-rest-api.sh
Created
April 6, 2022 10:55
-
-
Save rafaelcalleja/0dfab1e3b2919ba7ca2d5ce9c69137b2 to your computer and use it in GitHub Desktop.
Create RabbitMQ queue and exchange with binding using REST API
This file contains hidden or 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