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
Authors have earned$10,071,608writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Learn more about writing on Leanpub
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
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), EPUB (for phones and tablets) and MOBI (for 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
Top Books
C++ Best Practices
Jason TurnerLevel up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
Digital-First Events
Joep Piscaer and Jana BorutaThe only resource you will ever need to launch your digital events program.
node-opcua by example
Etienne RossignonGet the best out of node-opcua through a set of documented examples by the author himself that will allow you to create stunning OPCUA Servers or Clients.
Cloud Strategy
Gregor Hohpe“Strategy is the difference between making a wish and making it come true.” A successful migration to the cloud can transform your organization, but it shouldn’t be driven by wishes. This book tells you how to develop a sound strategy guided by frameworks and decision models without being overly abstract nor getting lost in product details.
R Programming for Data Science
Roger D. PengThis book brings the fundamentals of R programming to you, using the same material developed as part of the industry-leading Johns Hopkins Data Science Specialization. The skills taught in this book will lay the foundation for you to begin your journey learning data science. Printed copies of this book are available through Lulu.
C++20
Rainer GrimmC++20 is the next big C++ standard after C++11. As C++11 did it, C++20 changes the way we program modern C++. This change is, in particular, due to the big four of C++20: ranges, coroutines, concepts, and modules.
The book is almost daily updated. These incremental updates ease my interaction with the proofreaders.
Sockets and Pipes
Type ClassesSockets and Pipes is not an introduction to Haskell; it is an introduction to writing software in Haskell. Using a handful of everyday Haskell libraries, this book walks through reading the HTTP specification and implementing it to create a web server.
Atomic Kotlin
Bruce Eckel and Svetlana IsakovaFor both beginning and experienced programmers! From the author of the multi-award-winning Thinking in C++ and Thinking in Java together with a member of the Kotlin language team comes a book that breaks the concepts into small, easy-to-digest "atoms," along with exercises supported by hints and solutions directly inside IntelliJ IDEA!
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Introducing EventStorming
Alberto BrandoliniThe deepest tutorial and explanation about EventStorming, straight from the inventor.
Top Bundles
- #1
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #2
Django for Beginners/APIs/Professionals
3 Books
- #3
CCIE Service Provider Ultimate Study Bundle
2 Books
Piotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification... - #4
Cisco CCNA 200-301 Complet
4 Books
Ce lot comprend les quatre volumes du guide préparation à l'examen de certification Cisco CCNA 200-301. - #5
Modern Management Made Easy
3 Books
Read all three Modern Management Made Easy books. Learn to manage yourself, lead and serve others, and lead the organization. - #6
Linux Administration Complet
4 Books
Ce lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité... - #7
CCDE Practical Studies (All labs)
3 Books
CCDE lab - #8
All the Books of The Medical Futurist
6 Books
We put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy, digital health investments and how technology giants such as Amazon... - #9
Cloud Architect: Transform Technology and Organization
2 Books
Architects don't just recite product names and features. They understand the options, decisions, and trade-offs behind them. They earn credibility and maintain authenticity by connecting the penthouse with the engine room. Get two essential books that redefine the role of the software and IT architect at one low price:37 Things One Architect... - #10
Mastering Containers
2 Books
Docker and Kubernetes are taking the world by storm! These books will get you up-to-speed fast! Docker Deep Dive is over 400 pages long, and covers all objectives on the Docker Certified Associate exam.The Kubernetes Book includes everything you need to get up and running with Kubernetes!