Tuesday, April 8, 2008

Review of Three JMX Books

There are several good books that cover the basics of the Java Management Extensions (JMX) specification. Unfortunately, they are all somewhat outdated at this point. While the basics of JMX are largely the same now as when these books were published, there are many new concepts and additions to JMX that make JMX much easier to use and more flexible than when these books were published. Although just about anything one might want to know about JMX can now be found on the web in articles, blogs, and book chapter excerpts, it is still sometimes useful to have access to a solid JMX book for reference or as a single source to learn about JMX.

In this blog entry, I provide my opinions of three JMX books that I have spent significant time reading and learning from. The three books that I have used to learn about JMX and which I use as JMX references are (in order of publication) Java Management Extensions (O’Reilly), JMX in Action (Manning), and Pro JMX (Apress). I will review them in the same order in which they were published. Before my individual book reviews, however, I will make some general observations regarding these JMX books.

All three of these JMX books, because of their publication dates, do not cover the following “staples” of modern JMX:
* Platform MBean Server provided with J2SE 5 and Java SE 6, including all the useful JMX utility classes introduced with J2SE 5 and Java SE 6
* MXBeans
* Web Services Connector as defined by JSR-262
* JConsole
* Spring framework support for JMX
* Ability for all types of MBeans, not just Model MBeans, to have Descriptors
* JMX best practices and lessons learned are not as prevalent (though some are mentioned in these books) as they are now simply due to lack of time to learn these lessons and observe and collect these best practices.

Another common characteristic of all these JMX books is that none has had a second edition. The reason for this in the case of the O’Reilly JMX book has to do with apparent lack of interest in the first edition. It wouldn’t surprise me if this was at least part of the explanation for no second edition of any of these JMX-focused books.

Java Management Extensions, O’Reilly

The first of the JMX books, this is a useful introductory text for the basics of JMX. Because of its early release date, it does not have any significant coverage of Remote JMX concepts, though it does cover the concept of JMX Connectors versus JMX Adapters as well as could have been done at time of publication. One of the strengths of this book is the chapter introducing all of the MBean types followed by individual chapters devoted to each MBean type available at the time (Standard, Dynamic, Model, and Open). The individual, highly detailed chapters on each type of MBean make this a useful reference for writing these different types of MBeans and the introductory chapter on all types of MBeans helps compare and contrast the MBean types while providing guidance on which MBean types are best for which situations.

A significant advantage of this book that contributes to its value as a reference is its index. I have been frustrated by some technical books that do not include a thorough index. In such cases, I often find myself needing to write in page numbers and topics not already listed in the index but covered in the book. It is very frustrating to know (or at least seem to remember) something covered in a book, but having to spend considerable time finding it again. This O’Reilly JMX book has a thorough index that I seldom find myself needing to add any new topics or page references in. This certainly contributes greatly to its value as a reference.

For me, the biggest disadvantage of this book is exactly what was its advantage at time of publication – it being the first JMX book released. The book is well-written and useful, but by nature of being the earliest of the JMX books reviewed here necessarily lacks some of the developments in JMX that occurred shortly after this book’s publication. The most glaring of these omissions is lack of coverage for remote JMX. The book’s author has blogged about a desire to write a second edition covering some of these newer features, but explained that the first edition did not sell well enough to justify a second edition. That’s a shame because this is a very useful JMX reference and a greatly enhanced second edition would be welcome.

There are several specific characteristics of this JMX book that I have found to be particularly useful. These include the description of using TYPE in descriptors for fundamental types (pp. 67-68) and the coverage of the different types of MBeans. I like how this book covers each of the four types of MBeans briefly and in relation to each other early in the book (pp. 4-12) and then provides a chapter dedicated to each individual type of MBean. This approach is useful because the early introduction allows one to quickly compare the MBean types and to see how they differ. Then, the dedicated chapters provide a nice reference for details on each MBean type. Of course, MXBean was not around at the time and so is not a covered MBean type.

Other reviews for Java Management Extensions are available and include Does O'Reilly's New Book Explain What You Need to Know about JMX? and the Plano Java Users Group review.

At the time of this writing, Chapter 2 of Java Management Extensions is currently available for free download from http://www.oreilly.com/catalog/javamngext/chapter/ch02.pdf.

JMX in Action, Manning

To me, the most compelling feature of this JMX book is the care taken to gently introduce JMX to readers with no previous JMX experience. This book does an excellent job of explaining why one might want to use JMX and of introducing JMX. I particularly liked the book’s explanation of the difference between a JMX Connector and a JMX Adapter. JMX in Action may be the best of the books for an introductory read on JMX. Like the O’Reilly book, JMX in Action focuses on different MBean types in different chapters and can be a useful JMX reference. Because it is newer than the O’Reilly book, it can also cover some JMX ideas that matured since publication of that book.

One of my favorite features of this book is its coverage of a ModelMBeanInfoBuilder class (starting on page 155). When I first used Model MBeans, I had a very similar idea in mind and it was nice to see it already coded. This example pre-dates J2SE 5 and so can be improved with use of generics, enums, and other nice features introduced with J2SE 5.

The most significant disadvantage of JMX in Action is the same as that of the O’Reilly JMX book – it predates Remote JMX and so does not cover that as well as one would like.

At the time of this writing, three sample chapters of JMX in Action are available for free download. These sample chapters are Chapter 2, Chapter 4, and Chapter 9.

There are several other reviews of JMX in Action, including this JavaRanch review (see bottom or go to this page) and the Denver Java Users Group review.

Pro JMX, Apress

I may be wrong about this, but it seems like this book may have originally (at least during writing) had a title of “Connecting JMX Clients and Servers.” In many ways, this would have been a more appropriate title for this book. This book focuses heavily on Remote JMX API and has relatively little coverage of JMX basics as compared to the two previously reviewed books. While an advantage this book has over the two previously reviewed versions is its coverage of the Remote JMX API, this advantage is somewhat reduced by the fact that much of the book’s content is exactly the same or nearly the same as the writing in the JMX specification (to which the author was a contributor). I prefer books covering a specification to provide significant abstraction and new perspective on the specification rather than being word-for-word or very similar to the specification.

Another review of Pro JMX is available in Val’s Review of Pro JMX.

Chapter 3 of Pro JMX is available for download (at time of this writing) at http://www.apress.com/book/downloadfile/1743.

Additional JMX Book Resources

There are some other reviews of JMX books out there. Of course, Amazon.com and Bookpool and other book sellers have reviews on their sites (some of these books can be purchased at deep discounts through Amazon Marketplace or other used book selling options). Sandy McArthur provides brief reviews of two JMX books here. Additional details on freely available JMX book chapters can be found here. Chapter 2 of Java and JMX: Building Manageable Systems [Addison-Wesley] (a book I have not read and did not review here) is also available online for free review.

1 comment:

Steve Chambers said...

This was very helpful, thanks! It's saved me time and money for sure, for which I'm grateful :-)