Email the Author
You can use this page to email River Bailey about RabbitMQ Layout.
About the Book
In the world of physical mail, there is a struggle to address letters and envelopes individually. In the world of email, it gets easier because you can send one letter to multiple address. But what do you do in the software world, when you need one application to communicate with multiple external processes, systems and other applications?
The "easy" way is like stuffing envelopes with copies of the same message. Only in this case, you have to re-write the message with a slightly different format and sent it to different API endpoints. The "right" way is to take advantage of systems like RabbitMQ that provide simple messaging infratructure for distributed applications.
But while there is a lot of flexibility with RabbitMQ messaging and topologies, there isn't a lot of information about how to organize things. There is very little out there that will show you how to create an exchange, routing and queue layout that makes sense for your application.
About This Book
In this book, you'll learn about the basics of RabbitMQ's Exchanges, Queues and the bindings between them. You'll learn about the 3 primary types of exchanges, and one exchange type that we won't bother with. These include:
- Direct Exchanges
- Fanout Exchanges
- Topic Exchanges
and worth mentioning, but not something that will be covered: Header Exchanges.
Part 1: RabbitMQ Exchanges
Part 1 of the book will introduce the three main exchange types that you will be using with RabbitMQ.
Chapter 1 will introduce the core concepts of RabbitMQ topologies. Chapters 2 through 4 offer a brief discussion of the features and behavior of each Exchange type, and binding them to destination queues.
Part 2: Understanding The Design And Decisions
Part 2 moves in to the application of RabbitMQ's topology options, providing a unique look at making decisions. With a myriad of options and features available, it is not always clear when and where you should use what.
Rather than providing a strictly technical approach to show you how to use RabbitMQ, part 2 takes a story-telling approach to guide you through the decision making paths of real world projects and systems. Through a narrative style that puts you in the mind of another developer, you will see the struggles, the success and some of the failures in designing a message based system with RabbitMQ.
Chapter 5 will show a sample job scheduling application, following a developer through a decision to implement RabbitMQ and organize it appropriately. The running jobs in the schedule can be put in to various states through an administrative web application, but how should the queues and exchanges be organized to facilitate this? The inspiration for the solution seems to come out of nowhere.
Chapter 6 follows a developer through the often painful process of discovering and documenting performance problems, and finding solutions to the issue. RabbitMQ is already in place, in this case, but was it the right thing to do? Should RabbitMQ be taken out of the equation in order to reduce the latency between requesting a download and actually sending the file back to the user? Find out whether or not RabbitMQ makes the cut in this story of struggling to improve the performance of a file sharing service.
Chapter 7 follows a developer with a side project that is quickly growing in popularity, and slowing in speed. The current setup is working fine for the end-user, but the background processing is grinding to a halt on the back-end. Latency problems are causing massive delays between a database call and integration with a 3rd party service that seems to fail more than it succeeds. Follow along with a developer that is bringing on a second team member while trying to understand how to keep a queue from becoming a backlog of thousands of messages.
Chapter 8 is a final look at RabbitMQ's topology options, building an application that takes the "Internet of Things" (IoT) to a new level. Step inside the mind of a developer who winds up working for a decidedly low-tech company, using cutting edge technologies to facilitate communication between work out in the field and maintenance bays back at the company headquarters.
Who Should Read This Book?
I wrote this book to speak to the problems that I found when learning RabbitMQ on my own. There were plenty of books, blogs and other resources available for the "how-to" of RabbitMQ, but I found the lack of "why-to" resources to be particularly frustrating.
If you're looking at RabbitMQ as a solution to your problems, and need to understand some of the decisions that go into building a RabbitMQ based system, then this book is for you. If you're in the middle of your first or second RabbitMQ implementation and are struggling to understand when you would use a Direct exchange vs a Fanout exchange, then look no further. If you're a technical leader or manager in a team of technical gurus, and need a high level overview of the decisions and criteria that your team will face, this book has you covered.
This book is for you - the application and system architect, the team lead and software developer. You will learn how to keep your RabbitMQ topology sane for your application.
You will learn not only the different types of exchanges in RabbitMQ and how they work, but when to use them and how to organize your RabbitMQ topology around them - all from an application perspective.
Who Should NOT Read This Book?
If you're looking for the authoritative "how-to" with RabbitMQ, you're looking at the wrong book. While I do provide a list of my favorite resources to cover this aspect of RabbitMQ, this book does not directly cover it.
If you're looking for a definitive, rules based guide to picking your exchange type, you will likely be disappointed. The truth is, most of the decisions made around messaging topology is fuzzy logic at best. This book will offer some real-world examples to illustrate areas where each exchange type works well, but it will not give you absolute constraints under which you should choose a specific option.
Additionally, this book is not going to teach you what you need to know about integrating disparate systems. It does not cover enterprise level integration needs, even if it does provide some discussion on the basic patterns and implementation details within RabbitMQ.
If you're looking for a guide to integration multiple large-scale or enterprise systems, this is *not* a book that you should be reading. To cover that material, I highly recommend the [Enterprise Integration Patterns](http://bit.ly/db-rmq-eip) book instead.
With that said, I hope you are set for an intriguing look inside the minds of other developers as they work their way through the struggles and the success of working with RabbitMQ.
About the Author
Derick Bailey is an entrepreneur and software developer in central Texas He's been slinging code since the late 80’s and doing it professionally since the mid 90's. These days, He blogs at DerickBailey.com, produces screencasts at WatchMeCode.net and tweets as @derickbailey.