Service-Oriented Reliable Queuing (Majordomo Pattern)
The nice thing about progress is how fast it happens when lawyers and committees aren’t involved. Just a few sentences ago, we were dreaming of a better protocol that would fix the world. And here we have it: the Majordomo Protocol.
This one-page specification turns PPP into something more solid (Figure 4-4). This is how we should design complex architectures: start by writing down the contracts, and only then write software to implement them.

Figure 4-4. The Majordomo pattern
The Majordomo Protocol (MDP) extends and improves on PPP in one interesting way: it adds a “service name” to requests that the client sends, and asks workers to register for specific services. Adding service names turns our Paranoid Pirate queue into a service-oriented broker. The nice thing about MDP is that it came out of working code, a simpler ancestor protocol (PPP), and a precise set of improvements. This made it easy to draft.
To implement Majordomo, we need to write a framework for clients and workers. It’s really not sane to ask every application developer to read the spec and make it work, when they could be using a simpler API built and tested just once.
So while our first contract (MDP itself) defines how the pieces of our distributed architecture talk to each other, our second contract defines how user applications talk to the technical framework ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access