Enterprise Integration Zone is brought to you in partnership with:

Edward has posted 1 posts at DZone. View Full User Profile

ActiveMQ in Action

  • submit to reddit
Published by: Manning
ISBN: 1933988940

Reviewer Ratings




Buy it now

One Minute Bottom Line

Excellent book.  Thorough coverage of JMS, MOM and how to do it all with ActiveMQ.  Highly recommended.


Manning was kind enough to provide me with an EAP (Early Access Program) copy of ActiveMQ in Action for review.  The copy only contains chapters 1-6, 8, 12 and 14 (the other chapters are in-progress).  The book offers a soups-to-nuts coverage of ActiveMQ - starting out with the assumption that the reader has no knowledge of Message-Oriented-Middleware (MOM) and progressing through the background, installation, setup and configuration, persistence and security for ActiveMQ. Word of warning: MOM and JMS and related technologies have dozens of 3 and 4 letter acronyms, so be prepared. Since ActiveMQ is primarily used with Java, the book devotes an entire chapter to writing Java applications that use ActiveMQ.   However, the authors also give example code for Ruby, Python, PHP, perl, C#, C++ and information on building RESTful applications with ActiveMQ.  The remaining chapters cover tuning, administration, and monitoring of ActiveMQ.

The introductory chapters are important for those who are relatively new to MOM and provide a good overview of the Java Message Service (JMS) API, covering both point-to-point and Publish/Subscribe messaging.  The book explains Enterprise Messaging, and some of the problems it is designed to solve.  The authors then dive into JMS, explaining the concept of a the JMS Provider and the anatomy of a JMS message, both the headers and the properties.  There is then the explanation of the difference between point-to-point and Publish/Subscribe messaging.  The difference between Durability and Persistence is described.  Finally, there is a list of the steps needed to send and to receive a message, followed by sample code for a message producer and two consumers: (1) a standard message receiver and a Message Driven Bean (MDB).  This is followed by an explanation of how ActiveMQ implements the JMS 1.1 specification and provides some reasons for using ActiveMQ (compliance, support for any JEE compliant application server, and the ability to use it with any of the languages listed above.  The download and setup information could have gone into an appendix - since it is mostly boiler-plate and can be skipped if you already have the software downloaded and installed.  The authors then work through a couple of examples, so that by the end of chapter 2, you have ActiveMQ installed and a couple of straightforward example programs running.

The authors then explain Connectors and how you configure them.  This topic is often omitted entirely when talking about JMS and its inclusion is welcome.  Client-to-broker, broker-to-broker and even broker-discovery in a clustered environment.  Here the configuration of particular transports is covered (TCP and UDP) and higher-level transports like SSL and how to generate a certificate for use with SSL.  By the end of this chapter, you know how to set up ActiveMQ brokers and know how to configure them to talk to one another and to clients.

Message persistence is also covered in extreme detail. This various methods supported by ActiveMQ are described, along with great detail on exactly how to configure persistence.  This is another topic that is often glossed over, or only one option is discussed.  Here, all of the options are thoroughly explained.  The same goes for Security - a good coverage of the basics and details on configuration.

Chapter 6 pulls all of the previous topics together into an application.  The example shows setting up a BrokerService and gives a Java example of the configuration and startup.  If you use the Spring framework, you will also find some sample code on integrating ActiveMQ and Spring - including the Broker and Clients.  Another good touch of a full example is good.

The final chapters talk about Tuning, Administration and Monitoring.  These are very useful, since tuning can be a black art - especially where JMS is concerned.  The various ways you can tune ActiveMQ and the trade-offs you can make in performance.  This also dovetails nicely with Administration and Monitoring, since we need to implement our tuning and then measure it to ensure that we are getting the desired effect.   The details on Java Management Extensions (JMX) and writing Managed Beans (MBeans) are welcome.

What I like about the book: 
The authors do a very good job of starting with the basics and taking the reader through the whole process of getting ActiveMQ up and going, while at the same time, explaining the underlying JMS APIs and show the power of Java Messaging.  The authors obviously understand MOM very well and ActiveMQ in particular.  I wish more chapters were available -- I like the topics that are on the list of chapters still to be written.  The level of detail is also welcome.  It is possible to skim through to get the basics, but when you go back, all of the details are there - when you need them.

What I didn't like: 
There are several advanced topics that the authors should really cover. One is  replacing app-server implementation of JMS with ActiveMQ.  The authors (on the message board for the book) do make the point that that would require going deep into JTA and app-server internals -- which would require a lot more pages to cover than they have.  But it was originally in scope for the book and I would like to see it covered.  This is beyond what the average book on Messaging would cover, but someone who is already conversant with JMS and Message Queuing would need that information to integrate with a particular application server.

Published at DZone with permission of its author, Edward Gardella.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


Manuel Jordan replied on Sat, 2009/11/28 - 4:16pm


I am very intererest in read this book, this is an important topic


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.