RabbitMQ Layout
RabbitMQ Layout
Basic Structure and Topology for Applications
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.
Bundles that include this book
Table of Contents
-
- Before You Start Reading This Book …
-
Preface
- One Card, Many Deliveries
- Enter RabbitMQ
- About This Book
- Who Should Read This Book?
- Who Should NOT Read This Book?
-
Part 1: Exchanges, Queues and Bindings
-
Chapter 1: The Basics Of Sending Messages
- Routing Messages
- RabbitMQ Exchange Types
- One Exchange to Rule Them All?
-
Chapter 2: Direct Exchanges
- An Example: Job Requests
- Routing Keys
- Many Exchanges Bound To Many Queues
- When To Use Direct Exchanges
-
Chapter 3: Fanout Exchanges
- An Example: Notifications
- Routing Keys
- One Exchange, Many Queues
- When To Use Fanout Exchanges
-
Chapter 4: Topic Exchanges
- An Example: Logging
- Routing Keys
- When To Use Topic Exchanges
-
Chapter 1: The Basics Of Sending Messages
-
Part 2: Applications, Topologies and Decisions
-
Chapter 5: Changing Job States In A Scheduling System
- Inventory of Existing Queues and Exchanges
- A Simple 1:1 Exchange:Queue Setup
- Reducing Topology Bloat
- Epilogue
-
Chapter 6: Reducing Response Time
- Documenting The Process / Problems
- Questioning The Current Design
- Research and Planning
- You Want To Use What?!
- Designing The RabbitMQ Solution
- Epilogue
-
Chapter 7: Increasing Workload and Workers
- Slowly Getting Slower
- A Growing Team, A Growing Problem
- Re-Routing The Database and Analytics Message
- An Overloaded Queue
- Epilogue
-
Chapter 8: Remote Diagnostics and Maintenance
- A Not-So-Working Prototype
- Push Notifications
- A Now-Working Prototype
- Epilogue
-
Appendix A: Additional Resources
- WatchMeCode: JavaScript Screencasts
- The RabbitMQ Tutorials
- RabbitMQ In Action
- RabbitMQ In Depth
- Enterprise Integration Patterns
- About Derick
-
Chapter 5: Changing Job States In A Scheduling System
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them