Book: ActiveMQ In Action

Book Cover of ActiveMQ In ActionI am, for many years, an active reader of the Manning serie called “in Action“. I probably bought half of the collection in printed edition. Not only because I’m pretty convinced some of them will become collectors (for example, the first version of “Struts in Action” for which I also own the accompanying T-Shirt) ;-), but also because I really enjoy the style of the collection and the way the chapters are structured. However, don’t believe I’m writing this review with a biaised opinion, because I have also been disappointed occasionally by some offsprings of the Manning family.

Please, note this review is based on one of the latests MEAP -Manning Early Access Program- edition offered in order to allow the avid readers to access the content of the book while it is being edited. This version should however be very similar to the printed edition.

Before we dive into the real content, let me introduce the authors. The book is written by three different persons, what in my opinion seems to be the maximum number of authors in order to ensure a consistent quality. However, in the case of “ActiveMQ In Action“, the CVs are pretty amazing:

  • Bruce Snyder is perhaps the most famous one of the three (at least I knew his name before reading his book ;-)). To name just a few things, he’s a member of the Apache Software Foundation and he works for SpringSource as Senior Engineer. He is also one of the developers for ActiveMQ. Additionally, he has already coauthored a few books: “Maven, the definitive guide“, “Beginning Spring framework 2” and “Professional Apache Geronimo“; and he has participated in the Expert Groups for JSR 243 “JDO 2.0“, JSR 221 “JDBC 4.0” and JSR 291 “Dynamic Component Support for Java SE“.
  • Dejan Bosanac is a Senior Software Engineer at FuseSource, a Progress Software company. He is an active committer on ActiveMQ, the author of “Scripting in Java: Languages, Frameworks, and Patterns” and he has also participated in the Expert Group for JSR 223 “Scripting for the Java Platform“.
  • Rob Davies is Chief Technology Officer at FuseSource. He is a founder of the Apache ActiveMQ, ServiceMix (Open Source ESB) and Camel projects. He has more than twenty years of experience in project management, software design and development with banking and telecom companies.

Now about the book! It is divided into four sections:

1. An introduction to Messaging and ActiveMQ that starts with a quick but very concrete overview of the subject (in the typical “In Action” style), and continues with a detailed explanation of the concepts of Message Oriented Middleware and JMS in order to lay down the necessary background knowledge.

The first chapter is a clear and concise quick start guide to ActiveMQ. It gives a high level picture of the subject, detailing the concepts of asynchronicity and of loose coupling and citing straightforward cases of usage. Then, it explains how to download, install and start it and how to run one of the examples provided with the MOM. I like the brevity of this chapter and how it goes directly to the subject: you can get a running ActiveMQ server in less than five minutes, at least if you already know a little bit about ANT. If you don’t know ANT, don’t worry: it’s not very difficult and basically you’ll just have to install it. This is probably the ultimate test to identify if you should be reading the book or not 😉

I remember I was feeling a bit disappointed when reading this chapter because I was expecting a JMS version of “Hello World” right at the start, and instead it was “just” the execution of a prebuilt example. But I’m too much used to the “In Action” books and browsing the second chapter I have realized that was coming soon.

The second chapter is a tutorial about JMS. It’s there just in case you have never used JMS before, or you haven’t used it for a long time. It’s a good refresher on the subject because it explains really a lot in just a few pages. However, don’t expect to find all in details: this is a book about ActiveMQ, not a book about JMS. You’ll find an explanation of the base principles (the types of jms messages, the jms domains: queueing and publish/subscribe), a description of the java classes and interfaces in the JMS specification, and an example of a simple application (the long awaited “hello world”) for each type of JMS domain. You won’t be a JMS expert after reading this chapter, but you will have all the ingredients in your hands to start using it and eventually become one.

The third chapter, that also closes the first section of the book, lays down the two example applications that will be used to introduce the many features of ActiveMQ through the rest of the book. These two examples are classical choices that are correctly balanced in difficulty and in openess to change; in order to be able to adapt to many usage scenarios. They are presented with sufficient details, including the download and installation of Maven, how to launch them and an extract of the expected results.

In this first section, I just regret not finding a quick comparison of ActiveMQ to a few other open-source solutions (RabbitMQ, OpenMQ, HornetQ…), or even non open-source ones (WebsphereMQ, SonicMQ, MuleMQ…). However I can understand this would have been a very difficult exercise. So maybe getting an overview of the features that make ActiveMQ a better choice in the crowd of JMS solutions would have been really nice instead. Next edition?

2. The second section dives you directly into the bowels of the beast with the exposition of the most important aspects of the MOM server: the connectors, the security and the options for the storage of messages.

The fourth chapter is about the configuration of the connectors, both the transport connectors used by the clients in order to connect to the message brokers, and the network connectors used in order to interconnect the broker servers. This chapter starts first with a presentation of the unified format of URLs used by ActiveMQ in order to configure and to reference the different types of connector. Then, after a brief overview of all the connectors, it goes into more details explaining for each one the pros and cons, when you should consider using it, and how to set it up (with a reference to the detailed documentation for the more advanced settings). This rather lengthy chapter is organized more like a reference material. I suggest, as the authors do, that you skip few subsections and come back when you actually need it. Just make sure you understand at least one example of connector in each category: transport and network.

Chapters 5 and 6 are very important for a good mastering of the subject.  With chapter 5, you really start to understand the power of ActiveMQ because it talks about the storage systems (for persistent and non-persistent messages), details the differences for queues and topics and exposes deeply the four different storage systems that you can use with ActiveMQ. It then focuses on the caching strategies that you can deploy in order to speed up the retrieval of messages.

Chapter 6 is about securing the destinations using simple or JAAS mechanisms (for authentication and authorization) going into the details of implementing JAAS login modules. Then it elaborates on message level authorization, on building a plugin in order to implement custom authentication and authorization, and on integration of ActiveMQ with certificates based security. This closes the second section.

3. The third section is more about the integration of ActiveMQ into you own environment.

Chapter 7 focuses on the integration in Java and Spring environments, explaining with great details the different strategies for embedding the broker in your Java applications and the various configuration options that are offered when you use it with Spring. This chapter is really polished, because it also includes the development of clients using Spring and it talks about the important topic of implementing the request-reply mechanisms using JMS.

Chapter 8 shows, with an example application, how to integrate with different servlet containers or application servers. It is demonstrated using Tomcat, Jetty, JBoss and Apache Geronimo. I regret there is not more examples with other application servers like Glassfish or Weblogic, but I suspect the goal of the authors was more to show the mechanism in details with various types of platform so you can help yourself after by searching a bit on the web if necessary. This would make sense because this chapter is probably going to be outdated very fast.

The next chapter is about the usage of ActiveMQ from other languages. The scripting languages are detailed first, with the usage of the STOMP protocol for Ruby, Python, PHP and Perl; .NET/C# and C++ are detailed next. Then the chapter cleverly elaborates on SOA and RESTful access to the broker for WebServices, and also on the access using Ajax.

4. The last section concerns the advanced usage of the broker in your entreprise. I won’t develop further here because of the diversity and complexity of the topics covered. But -to name just a few subjects- this section covers clustering, scaling and load balancing, high availability, network and storage topologies, multicasting, logging, monitoring and statistics, administration of the broker, usage of wildcard and multiple destinations, system notifications and the virtual messaging, …the list continues and it is really long.


The overall writing quality is excellent. The text is very comprehensive. This is an important point for me as I am not a native english speaker and I don’t always manage to find a lot of time to read. I could however spot a few (actually, very few) typos, but nothing serious. The style is direct and concise and the subject is treated very seriously. Though I would have appreciated to find a few funny quotes, because I feel they help to relax a bit while reading and so help to memorize better. But this is more of a personal taste, maybe not shared with everyone who could rather see this as a distraction.

In conclusion, a must read book for anyone interested into the subject.


About nidget

Technology enthousiast, Java and JEE expert, IT architect.
This entry was posted in Reviews and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s