JMS - Overview of JMS API



Description

The Java Messaging Service is an API used in J2EE technology for exchanging information between two separate and independent network entities (group of hosts). It also provides reliable, asynchronous communication with other applications.

Before beginning with JMS API, we will see what is messaging system?

Message is an information that communicates between different components in the same system or different systems. Message can be a text, XML document, and JSON data etc which take place either in synchronous or asynchronous manner. A client can create, send, receive and read the messages by using the messaging agent. Messaging is quite different from electronic mail (e-mail). E-mail communicates between people whereas Messaging system communicates between software applications or software components.

JMS API

The Java Message Service API provides a set of interfaces for applications to create, send, receive, and read messages. It also exchanges information between different systems. It provides reliable and asynchronous communication to implement the messaging systems in Java-based applications. It maximizes the portability of the JMS applications in the messaging domain.

If you develop the messaging system by using JMS API, then you can deploy the same application in any JMS Provider software.

JMS application contains following elements −

  • JMS clients − JMS clients use JMS API to send and receive messages.

  • Messages − It includes the data which will be exchanged between JMS clients.

  • JMS provider − It is a message oriented middleware software, that provides UI components to administrate the JMS application.

  • JMS Sender − It is commonly known as JMS Producer or Publisher, which is used to send messages to destination system.

  • JMS Receiver − It is generally known as JMS Consumer or Subscriber, which is used to receive messages to the destination system.

JMS Messaging Domains

JMS provides two types of messaging domains −

  • Point-to-Point Messaging Domain
  • Publish/Subscribe Messaging Domain

Point-to-Point Messaging Domain

In this type, it includes a sender, a receiver and a queue in which one message will be sent to only one receiver. Each message will communicate to a specific queue. The queue will carry the message until receiver is ready.

Publish/Subscribe Messaging Domain

In this type, it includes multiple publishers and multiple consumers in which one message will be sent to all clients. Here, both publishers and subscribers are generally unknown and they will have timing dependencies. They can publish or subscribe to the topic, which manages the delivery of messages.

We will look on point-to-point and publish/Subscribe approaches in the upcoming chapters.

JMS Providers

The following table shows available JMS providers −

S.N. JMS Provider Software Company
1 WebSphere MQ IBM
2 Weblogic Messaging Oracle
3 Active MQ Apache Foundation
4 Rabbit MQ Rabbit Technologies (obtained by Spring Source)
5 HornetQ JBoss
6 Sonic MQ Progress Software
7 TIBCO EMS TIBCO
8 Open MQ Oracle
9 SonicMQ Aurea Software
Advertisements