SwedenDrew
SwedenDrew

Reputation: 61

Scripting RabbitMQ bindings

I want to set up a bunch of rabbitMQ exchanges and queues together with their bindings trough a Octopus deploy step. We're using NServiceBus and we don't want to give the application too much permission hence it can't set up the stuff itself.

Previously we've had a powershell script for setting up virtual host and users and I've been looking at extending this so that we can create the queues, exchanges and bindings too. This script uses RabbitMQ REST API. The queues and exchanges can be created without any hazzle but the bindings are another matter. I can't find any suitable documentation about setting this up over HTTP. I've read something that this is not the preferred way to do stuff but what options are available to me given octopus scripting?

The code I want to execute is something like this:

http://localhost:15672/api/bindings/TestHost/e/nsb.delay-level-00/q/nsb.delay-level-00

The exchange is named nsb.delay-level-00 and the queue has the same name. Both exists in the rabbitMQ virtual host.

Any ideas?

Upvotes: 0

Views: 184

Answers (1)

SwedenDrew
SwedenDrew

Reputation: 61

I found out that, in contrast to creating queues and exchanges, the method call has to be a POST in this scenario.

So, POST http://localhost:15672/api/bindings/TestHost/e/nsb.delay-level-00/q/nsb.delay-level-00 works fine.

Upvotes: 1

Related Questions