Chapter 9. Controlling Rabbit with the REST API
This chapter covers
- Limitations and abilities of the Rabbit REST API
- Managing Rabbit permissions from code
- Accessing messaging statistics and counters
- Automating user and virtual host creation
Up to this point, you’ve been limited in your ability to configure RabbitMQ servers from apps or scripts. Sure, you could write code that runs rabbitmqctl and then tries to “scrape” the output for results but that’s a brittle solution and is likely to break anytime the guys at Rabbit decide to change rabbitmqctl’s output. In reality, both rabbitmqctl and the management web UI are designed for interaction with something that has a heartbeat. So where does that leave you when you want to automate the deployment of your RabbitMQ servers with tools like Chef, Puppet, or even CFEngine? Also, what about the more basic need to monitor RabbitMQ? How are you supposed to write health check scripts to keep an eye on your Rabbits without a programmatic window into RabbitMQ’s inner workings?