Site icon TestingDocs.com

What is JMS API?

Overview

JMS is a short form for Java Message Service. JMS API allows applications to create, send/receive, and read messages. Messaging is a method of communication between applications. A messaging client can send messages to, and receive messages from other clients. Messaging enables communication between software applications in a loosely coupled environment.

Furthermore, JMS API is both reliable and asynchronous. It provides support for both point-to-point and publish/subscribe messaging models.

JMS Architecture

JMS clients are programs that produce or consume messages.

Messages are objects that communicate information between the JMS clients.

JMS provider: is the messaging system that implements JMS specification interfaces and provides administrative features.

Point-to-point

In point-to-point communication, the sender sends the message to a specific queue. The receiver client extracts the messages from the queue. The queue retains all the messages until the clients consume them or expire.

Each message has only one consumer. The consumer client acknowledges the receipt of the message as shown below picture.

 

Publish/Subscribe

In publish/ subscribe messaging system, a client subscribes to a topic. The publishing client publishes messages on the topic by creating a subscription. Each message in the system might have many consumers unlike the earlier one. The publishing client can send messages to many subscribers who subscribe to the topic.

 

Exit mobile version