With distributed computing, many software components of one workingsystem may be separated geographically. The need for these componentsto communicate is obvious, and this need drives many software designdecisions. For instance, you might choose to use CORBA, SOAP, ormessage-oriented middleware for intercomponent communication.
SOAP-based web-service development continues to grow, and uses XMLand HTTP to remove the implementation details from remote procedurecalls. But while SOAP has broken new ground in distributed computing,message-oriented middleware such as the Java Message Service (JMS) isstill my tool of choice when reliability, performance, and security aretop priorities.
JMS is a specification (java.sun.com/products/jms) that describesthe properties and behavior of an information pipe for Java software.It also describes how Java client applications interact with theinformation pipe. In this article, I examine messaging concepts andimplement a JMS application.
What Is Messaging?
The concept of messaging begins with the goal of delivering data.Enterprise messaging forms the basis for an infrastructure dedicated tocommunication between disparate components in distributed softwaresystems. The important components in messaging systems—producers,consumers, and the messages themselves—are abstracted via interfaces.The result is a set of loosely coupled components that are part of acohesive software system.
Components that are loosely coupled have as few direct interactionswith one another as possible. This isolation leads to more robustsoftware, as changes to one part of the system do not ripple through toother parts. A good messaging system does this by abstracting thecomponents from one another in the system. (For more information, seemy book Java Messaging , Delmar-Thomson Learning Inc., 2006.)
Every messaging system consists of a broker component that isresponsible for delivering messages to and from the various componentsinteracting with the messaging system. Messaging brokers generallytreat messages as opaque, meaning they tend to ignore the contentwithin the message.
In fact, the broker does not need to know the purpose or content ofa message to deliver it. In turn, the software components thatsend/receive the messages don't need to know how the messages aredelivered, or which components sent them. The important part is thatthey are sent and received reliably.
Eric Bruno has worked extensively inJava and C++ developing real-time trading and financial applications.He can be contacted at email@example.com.