Java Message Service(JMS) specification v1.0.1 was released in October 1998, by JavaSoft. The JMS is an API for accessing enterprise messaging systems from Java.
A D V E R T I S E M E N T
For sending messages between two or more clients the Java Message Service(JMS) API uses a Java Message Oriented Middleware(MOM) API. JMS is a specification developed under the Java Community.
Message Oriented Middleware(MOM) provides a mechanism for integrating applications in a flexible, loosely coupled manner by providing asynchronous data delivery between applications in an indirect way through an intermediary.
What is an Enterprise messaging service?
A method for transmitting data from one enterprise application to another "Enterprise messaging" is used. Enterprise messaging eliminates the need to synchronize applications from multiple vendors running on different platforms, this is one of the main advantage. Products such as program-to-program messaging will become increasingly important as corporate IT groups build electronic commerce systems, which typically consist of a loose federation of applications that communicates over the Internet.
The Object Management Group(OMG), Microsoft, and Sun's JavaSoft are all working to make Enterprise messaging mechanisms which handles the transmission of messages between systems at different times, through store-and-forward mechanisms, or message queues.
The “message” is the common building block of a message. Messages are events, requests and replies that are created by and delivered to enterprise applications. With specific business meaning messages contain well formatted data.
Compared to the other distributed computing technologies such as Common Object Request Broker Architecture(CORBA) and Component Object Model(COM), Enterprise messaging is not relatively well known. Remote Procedure Call(RPC) architecture are the main background of these models. RPC allows one application to request a service from another application running on another platform. Which means the requesting application must cease running until the data from the other application is received, it is known as "synchronous" operation.
According to Ian Brackenbury, an IBM engineer and chief scientist in the company's Hursley Laboratory in Hursley, England. Enterprise messaging, on the other hand, is "asynchronous,". "A messaging infrastructure puts up a queue between an application on Machine One and an application on Machine Two," he says. "It provides the buffer between the different protocols and architectures on either side."
That's where the Java Messaging Service(JMS) comes in. JMS describes how to create reliable message queues. Reliable message queues are used to store packages that contain transaction or other information and the procedures used by the queues to exchange these packages.
What is an Java Messaging Service?
Java Messaging Service(JMS) is a set of interfaces and associated semantics that define how a JMS client accesses the facilities of an enterprise messaging product. Enterprise messaging is an essential tool for building enterprise applications and Ecommerce systems, and JMS provides a common way for Java programs to create, send, receive, and read an enterprise messaging system's messages.
The components in an application based around a message service send messages to a message server, rather than communicate directly with each other. The message server, in turn, delivers the messages to the specified recipients.
This might seem like an extra, unnecessary layer of software, but the advantages a message service provide often outweigh the disadvantages. The model behind the postal service is much similar to the message service model.
We could directly deliver our own mail, but letting someone else do it greatly simplifies our life. But it greatly simplifies the design of both the clients and the servers(they are no longer responsible for handling communications issues), and it greatly enhances scalability by the addition of the messaging service adds another layer to the application.
Goals of the JMS API:
A key goal of the JMS API is to minimize the set of concepts a Java programmer must learn in order to use messaging products and to unify the packaging of these capabilities.
Supports the development of the heterogeneous applications that span operating systems, platforms, architectures, and the computer languages.
Messages that contain XML pages are supported.
Supports messages that contain serialized Java objects
Provides an API that is suitable for the creation of messages that match the format used by existing, non-JMS applications.
The advantages of Java Message Service:
The quality of service issues such as reliable delivery are messaging service's responsiblity. This frees the components (which may be custom built) of the application from having to deal with these fairly generic issues.
Most of the Enterprise applications reside in multiple platforms. These heterogeneous platforms may receives or submits different types of messages. JMS is purely written in Java. As long the different components could understand the JMS message architecture, the platform which they reside and the programming language they are written is irrelevant.
JMS is responsible for delivering and queuing of the messages to the clients. This will free up the servers to process more information.
JMS component architecture will let the programmers built software products which are independent of messaging mechanisms. The coupling between the resources of the application will be minimal. This will enhance the reusability of the components and minismise development time for the application.
Most of the IT systems undergo heavy modifications and upgrade processes in a very short amount of time. This may result in changes at both the client and the server architectures. This problem of scalability is well addressed by Java Message Service(JMS). Since the messaging mechanism is independent from the application JMS will handle the alterations in the system.
System requirements for Java Message Service:
You need an editing environment. In a development context, many people use an integrated development environment(IDE) because it possesses debuggers and other features designed specifically for writing and testing code. This can also be as basic as an operating system editor.
You'll need the Java compiler(javac.exe), to compile the programs. You will also need the JMS classes in the package javax.jms and the Java Naming and Directory Interface(JNDI) classes in the package javax.naming. You can download these from Sun's website.
You will need access to a vendor implementation of JMS, to execute and test the programs. Most Java 2 Enterprise Edition(J2EE) vendors provide an implementation of JMS. See your vendor documentation for setting up the JMS runtime and executing programs.