Books

Book Review: Enterprise Integration Patterns

Enterprise Integration Patterns by Gregor Hohpe and Bobby Woolf is a seminal book on Messaging. Every developer working onĀ messaging solutions should read it. Even though it’s more than 10 years old, the content is still relevant. This is because the bookĀ focuses on patterns and principles and it’s technology agnostic. The authors do a good job on describing how you can combine the patterns together and presentĀ the trade-offs of different approaches.

Enterprise Integration Patterns

Structure

The book is split into 3 parts: introduction, patterns and interludes.

In the introduction (the first 3 chapters), the authors give a high level overview of messaging and integration. Then they go over theĀ differentĀ integration styles: file transfer, shared database, RPC and messaging.Ā I liked the fact that messaging is not sold as a silver bullet. The authors do a good job on presenting theĀ strengths and weaknesses of each approach. But, from my experience, messaging isn’t used as often as it should be. The other integration styles are more common in practice and this can lead to big balls of mud.

The patterns are grouped by topic. This makes it easyĀ to see how they relate to each other and which one to pick in a given situation. The main topics are: Message Channel, Message Construction, Message Routing, Message Transformation, Message Endpoints andĀ Systems Management. The patterns are presented by stating the problem they solve, the context in which they should be applied, the constraints that make the problem difficult and, of course, the solution. Each pattern has cross references to other patterns that can be applied next or that solve the same problem in a different way. The chapters are bite sized and easy to jump right in and read. This book provides a lot of value as a reference book. You can pretty much read each chapter separately.

The interludes put the theory intro practice. They describeĀ how to combine the patterns in order to implement a messaging solution. Most of them use JMS or MSMQ but are easy to understand even if you’re not a Java or C# developer. I especially enjoyed the example focused on system monitoring. Here,Ā the authors show us how to use patterns to check the health of the system. As they say, when you implement a messaging solution you shouldĀ spend a considerable amount of time implementing monitoring componentsĀ (unless the framework that you’re using does a big part of this work for you –Ā thanks NServiceBus!).

Biggest Takeaways

For me, the biggest benefits from this book are a shared vocabularyĀ and a deeperĀ understanding of how service bus frameworks work under the hood.

Shared Vocabulary

Since I’m working on a SOA solution, I’ve found the pattern language discussed in this book useful. I have used it whenĀ talking about design details with the team. Each pattern has a descriptive name and a simple icon that you can use in architectural sketches.

Even better, there is a companion website which has a high level overview of each pattern. This makes it easy to share the patterns with someone without having to pull out the 700 page book. It’s obvious that a lot of thought and work went in writing this book.

Understanding Messaging Frameworks

I once worked on a legacy project which used Microsoft BizTalk. Being thrown in it, without proper training, I found the concepts pretty hard to grasp. Now, after reading this book, I find BizTalk’s features much easier to understand (although I can’t say I miss working with it).

More recently, I’ve been working with NServiceBus.Ā I recognize many of the patterns in EIP as either features of NServiceBus or used under the hood to implement capabilities. I’m thinking of doing a blog post on this topic – how NServiceBus is using some well established patterns to implement higher level features.

Even if the framework you’re using already implements most of the patterns, it is still useful to understand them. Actually, these patterns should be consideredĀ when evaluating a messaging framework.

Improvements

I would have liked to see more content on the Process Manager pattern, since there are many ways in which you can use it (or abuse it) in practice. Luckily, Jimmy Bogard does a good job on describing different Process Manager patterns in his Saga Implementation Patterns blog post series.

Also, to keep the examples simple and focused on the patterns, the authors keep the state of stateful components in memory. I think that in at least one example state should have been persisted. This would haveĀ emphasizedĀ the importance of reliability –Ā not losing messages when a component crashes. The Composed Messaging interludeĀ could have been a good candidate for this.

The only chapter that I only skimmed was the last one – Concluding Remarks. It presentsĀ a bunch ofĀ emergingĀ standards that don’t seem to have much traction nowadays. I think this is the only chapter that feels outdated, but it probably provided much more value when the book was releasedĀ (13 years ago).

Conclusion

Enterprise Integration Patterns is a timeless book. Although it’s long (about 700 pages), I found it to beĀ easy to read. When I look at the messaging solutions that we use today, it’s clear that they have been influenced by these patterns. Also, it’s one of thoseĀ actionableĀ books – reading it opened my eyes on a couple of places where I could apply the patterns.Ā It’s a good way to gain a deeper understanding of integration patterns and structure your knowledge on messaging.