Foreword

Ted Neward

Principal Consultant,ThoughtWorks

For close to a decade now, I’ve been a fan of messaging-based systems. They offer a degree of reliability, flexibility, extensibility, and modularity that a traditional RPC or distributed object system simply cannot. Working with them takes a bit of adjustment, because they don’t quite behave the same way that an architect or designer expects a traditional n-tier system to behave. This is not to say that they’re better or worse; they’re just different. Instead of invoking methods on objects directly, where the object can hold conversational state or context, now the message itself has to be self-contained and state-complete.

Which raises an important point.

For any given developer with respect to any given technology, there are four distinct stages.

The first is the Ignorant. We may know the technology exists, or not, but beyond that we remain entirely ignorant about its capabilities. It’s a collection of letters, at best, often mentioned in conjunction with other technologies that may or may not matter to what we’re doing on a daily basis.

The second is the Explorer. Something piques our curiosity, voluntarily or not. We begin some initial forays into the jungle, perhaps downloading an implementation or reading a few articles. We begin to understand the basic framing of where this thing sits in the broad scheme of things and maybe how it’s supposed to work, but our hands-on experience is generally limited to the moral equivalent of “Hello World” and a few other samples.

The third is the Journeyman. After running many of the samples and reading a few articles, we realize that we understand it at a basic level and begin to branch out to writing code with it. We feel reasonably comfortable introducing it into production code and reasonably comfortable debugging the stupid mistakes we’ll make with it. We’re not experts, by any means, but we can at least get the stuff to compile and run most of the time.

The last, of course, is the Master. After building a few systems and seeing how they react under real-world conditions, we have a deep gestalt with it and can often predict how the tool or technology will react without even running the code. We can see how this thing will interact with other, complementary technologies, and understand how to achieve some truly miraculous results, such as systems that resist network outages or machine failures. When the Java Message Service (JMS) API was first released, back in 1999, before any noncommercial/open-source implementations were available, I distinctly remember looking at it, thinking, “Well, it seems interesting, but it’s not something I can use without a real implementation,” and setting my printed copy of the specification off to one side for later perusal. My transition to Explorer and Journeyman came a few years later, as I came to understand the power of messaging systems, partly thanks to the few implementations out, partly thanks to my own exploration of other messaging systems (most notably MSMQ and Tibco), but mostly due to the person who wrote this second edition of Java Message Service.

I’m still well shy of Master status. Fortunately, both you and I know somebody who is not.

Mark Richards has spent the last several years living the messaging lifestyle, both as an architect and implementor as well as a leader and luminary: the first in his capacity as a consultant, the second in his capacity as a speaker on the No Fluff Just Stuff (NFJS) tour. He has a great “take” on the reasons for and the implications of building message-based systems, and he brings that forth in this nearly complete rewrite of Richard Monson-Haefel and Dave Chappell’s first edition. Even if you’re in the Ignorant stage of JMS, Mark’s careful walkthrough of the basics, through implementation and then the design pros and cons of messaging will bring you to the Journeyman stage fast and leave you with the necessary structure in place to let you reach that Master stage in no time at all.

And that, my friend, is the best anybody can ask of a book.

Happy messaging.

Get Java Message Service, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.