Professional Java.JDK.5.Edition (Wrox)
.pdfDistributed Processing with JMS and JMX
This chapter shows you how to build distributed processing applications using two standard Java APIs. You can use this application as a starting point for CPU intensive processing tasks that require scaling beyond a single computer. In addition to scaling, the application discussed in this chapter can be managed very easily. It can be configured, deployed, even changed completely at run time using a standard Web browser.
Tough software problems often require large amounts of processing power. In some cases it is necessary to distribute this processing across several servers to meet the required demand. These systems are susceptible to bottlenecks and are difficult to manage. The two technologies discussed in this chapter — JMS and JMX — reduce the inherent complexities of this problem.
Java Message System (JMS) is the Java standard API for developing Message Oriented Middleware (MOM). JMS is one of the APIs that make up the J2EE architecture. JMS provides a robust message capability allowing you to send and process messages across several servers within a network.
Java Management Extensions (JMX) is also a Java standard API. JMX defines a way to provide manageable resources to other applications, provided they comply with the same architectural standard. This allows you to configure and manage applications at run time through standard management tools.
The first section, “Basic Concepts,” will explore the fundamentals of both JMS and JMX. It will not be an extensive laundry list of every method in the APIs; instead, it will be about the basics that you need to understand to be able to build a usable application. The focus of this chapter will be to expose you to a high value percentage of capabilities of these technologies that you can put to use in similar processing architecture problems. The second section, “Building a Distributed Application,” will show you how to build a usable example application. This application example will show how to model a generic business process. The third section, “Deploying the