JMS Tutorial – What is JMS

Filed Under: JMS

Nowadays, most of the enterprise applications are using messaging concept for asynchronous communication between heterogeneous applications using JMS or AMQP. I’m going to deliver a series of posts to discuss these concepts in detail with real-time examples in my coming posts.


  • JMS is the acronym for Java Messaging System.
  • JMS is part of Java EE.
  • JMS API is the implementation to handle the producer-consumer problem.
  • JMS API allows us to create, send, receive, and read messages.
  • Some o the benefits of using JMS are – loosely coupled application, reliability, and asynchronous communication.

What is Message?

The message is a piece of information. It can be a text, XML document, JSON data or an Entity (Java Object) etc. The message is very useful data to communicate between different systems.

What is Messaging?

Messaging means exchanging information between different components in the same system or different systems. It can happen in either a synchronous manner or an asynchronous manner.

What is JMS?

JMS stands for Java Message Service. JMS API is a Java API which contains a common set of interfaces to implement enterprise based messaging systems. JMS API is used to implement Messaging systems in Java-based applications only, it does not support other languages.

JMS API is used to create, send, receive and read messages or exchange messages between different systems. Once we develop a Java Messaging System with JMS API, then we can deploy the same application in any JMS Provider software.

JMS Architecture

JMS Architecture

An Enterprise Application may have ‘n’ number of components and they are exchanging messages by using one of the Messaging System as shown below.

JMS Messaging System

JMS Messaging System

Some Enterprise applications may have ‘n’ number systems and they exist in different locations. They use different platforms. If they want to exchange information in a loosely coupled manner, then we should use JMS Messaging system.

JMS in Distributed Systems

JMS in Distributed Systems

JMS Advantages

  • Loosely Coupled: We can develop loosely coupled applications very easily. That means JMS API is standard or specification that should be implemented by all JMS Providers so that we can change existing JMS Provider to new JMS Provider with little changes (that means only configurations) or without changing our JMS Application code.
  • Asynchronous: We can develop asynchronous messaging applications very easily. That means JMS Sender can send messages and continue on its own work. It does not wait for the completion of message consumption by JMS Receiver.
  • Robust and Reliable: JMS ensures that a message is delivered one and only once to the destination system. So we can develop reliable applications very easily.
  • Interoperability: JMS API allows Interoperability between other Java Platform languages like Scala and Groovy.

JMS Components

A typical JMS system contains the following components:

  1. JMS Client: Java program used to send (or produce or publish) or receive (or consume or subscribe) messages.
    • JMS Sender: JMS Client which is used to send messages to the destination system. JMS sender is also known as JMS Producer or JMS Publisher.
    • JMS Receiver: JMS Client which is used to receive messages from Source system. JMS Receiver is also known as JMS Consumer or JMS Subscriber.
  2. JMS Provider: JMS API is a set of common interfaces, which does not contain any implementation. JMS Provider is a third-party system who is responsible to implement the JMS API to provide messaging features to the clients.

    JMS Provider is also known as MOM (Message Oriented Middleware) software or Message Broker or JMS Server or Messaging Server. JMS Provider also provides some UI components to administrate and control this MOM software.

  3. JMS Administered Objects: JMS Objects which are preconfigured by an administrator for the use of JMS clients. They are ConnectionFactory and Destination Objects.
    • ConnectionFactory: ConnectionFactory object is used to create a connection between Java Application and JMS Provider. It is used by Application to communicate with JMS Provider.
    • Destination: Destinations are also JMS Objects used by a JMS Client to specify the destination of messages it is sending and the source of messages it receives. There are two types of Destinations: Queue and Topic.
  4. JMS Message: an object that contains the data being transferred between JMS clients.

Most popular JMS Providers

S.No.JMS Provider SoftwareOrganization
1.WebSphere MQIBM
2.Weblogic MessagingOracle Corporation
3.Active MQApache Foundation
4.Rabbit MQRabbit Technologies(acquired by Spring Source)
6.Sonic MQProgress Software
8.Open MQOracle Corporation
9.SonicMQAurea Software

History of JMS API

S.No.JMS API VersionReleased Date
1.JMS 1.0.2June 2001
2.JMS 1.1March 2003
3.JMS 2.0May 2013


JMS API is a robust way to implement a messaging system in our applications. There are various popular JMS providers including AMQP from Spring framework.

Reference: Wikipedia Article


  1. Christine Casillas says:

    My coworker is trying to convince me that JMS is both an API and a description of an API standard. The more we discussed and debated the differences, the more I got confused. Would you be able to help clarify this subject?

  2. Dhanraj Popalghat says:

    Short and sweet. It is very useful for beginers. I searched many articles for JMS. But I found this with basics like from defining what is message. Really really appriciated.馃檹馃憦

  3. Mantu says:

    thank you so much. It is really a nice article to start with JMS.

  4. Raushan says:

    Indeed a nice article. I’m delighted.

  5. Vijay Rajgor says:

    short and sweet superb

  6. ADKaran says:

    I need to know how can implement JMS application in netbeans IDE with glassfish server .

  7. Pradeesh says:

    Wonderful introduction… superb

  8. shariq says:

    its a nice post ,explained very clearly


    Please correct the typos. Nice post and thanks for starting JMS series.

  10. Rahul Sathe says:

    nice article… well keep glued for the next ones… thanks for writing..

Comments are closed.

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors