New Book Review: "RabbitMQ in Depth"
New book review for RabbitMQ in Depth, by Gavin M. Roy, Manning Publications, 2018, reposted here:
The bottom line: this book is one of the best organized, succinctly written technology texts I have ever run across, with a phenomenal mix of text, diagrams, and code. So if you are looking to adopt the RabbitMQ message broker in the near future, or to compare it heavily against other technologies in this space, look no further as you will quickly find that all other books on this product are either outdated or very poorly rated. While I initially took a gamble with this book, as there was essentially nowhere else to go in terms of books, it ended up working out nicely for my current development project at work.
The content is broken down into three parts: (1) RabbitMQ and application architecture, (2) managing RabbitMQ in the data center or the cloud, and (3) integrations and customization. The first part is where you will likely spend most of your time, as it consumes about 60% of the content and covers the bulk of what you will likely need to know. While the third part consists of more content than the second part, most readers will likely be more interested in the second part after working through the first part. While I worked through all exercises (using a prior installation of RabbitMQ 3.6.8 locally, and 3.6.12 in AWS) for the 80% of content contained in the first two parts, I limited my investment to reading the third part as it was not applicable to me at that point in time.
The first part covers foundational RabbitMQ, the AMQ protocol (AMQP), the 13 message properties contained within the Basic.Publish method frame of the AMQP specification, publishing and consuming messages, publishing tradeoffs, and message patterns via routing through direct, fanout, topic, headers, and consistent-hashing exchanges, as well as exchange-to-exchange binding. The second part covers RabbitMQ scaling using clusters, and cross-cluster message distribution. The third part covers use of alternative protocols and database integrations. Coding examples make use of Jupyter Notebook, and clustering and federation examples make use of AWS. All examples are explained in detail step-by-step.
As you work through the examples, keep the following in mind. First, try not to let coding example usage of Python be too much of a distraction if you are not planning to use RabbitMQ in conjunction with Python at work. However, if you do plan to use Python, make note that the "rabbitpy" library imported in examples throughout is developed by the author. Yes, you will see 15 contributors in GitHub, but the vast majority of commits have been made by Roy. Second, while an appendix is provided in the back of this book to walk through use of a Vagrant virtual machine containing everything that is needed to following along, I continue to think that performing all installs and writing all code is typically a better avenue to take when learning new technologies, and this case is no exception.
Third, keep in mind that some aspects of tasks to follow this route are not explicitly covered. One trivial example is that chapter 2 does not mention that the "rabbitpy" library must first be installed by entering "!pip install rabbitpy" in Jupyter. Later in this same chapter, however, you will need to copy the "erlang.cookie" file to get past an authentication failure. Additionally, you will likely need to make use of some of the following command line entries to get the first messaging examples working: "rabbitmqctl start_app", "rabbitmqctl status", "rabbitmq-plugins list", "rabbitmq-plugins enable rabbitmq-management", and "rabbitmq-plugins enable rabbitmq-management-agent". And for some of you, it might be worth knowing that the referenced management UI port of 15672 would need to be substituted with 55672 prior to RabbitMQ 3.0.
Later in chapter 6 you will likely come across the challenge of installing OpenCV ("Open Source Computer Vision Library"), as much of the community advice around this library is outdated, pertains to specific computing platforms, or is simply incorrect. In my case, after trying several different ways to install, I ended up entering "!pip install opencv-python" in Jupyter. Yes, this sounds very straightforward, but it might take some time to determine what will work specifically for your circumstances. While the author comments that he does not want readers to get sidetracked by paying too much attention to use of this library, since this is not the purpose of the example that demonstrates use of a direct exchange in conjunction with an RPC consumer, I think most developers would be interested in getting this fully working.
That said, in my case response messages were sent, but Python ended up complaining that no such file or directory could be found. It was not until this point in the book that I actually decided to take a look at the author's code in GitHub, and I narrowed down the likely cause of this complaint to a possible issue with "hashlib". In case you are wondering, the JPEG referenced by the error message is stored in a temporary folder using a cryptic junk file name. Later in chapter 7, the author makes note of the Erlang cookies I mentioned earlier during his walkthrough of setting up a local RabbitMQ cluster, but in chapter 8 when Roy provides a walkthrough of setting up multiple clusters in AWS using the RabbitMQ federation plugin, several AWS screens are either incorrectly referenced or showing evidence of how quickly they change. Did I mind the issues and author gaps that I just laid out? Not really, I learned quite a bit in the process.