JMS is 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 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 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.
In point to point communication, the sender sens 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 till expiry.
Each message has only one consumer. The consumer client acknowledges the receipt of the message as shown in below picture.
In publish/ subscribe messaging system, a client subscribes to a topic. The publishing client publishes messages to the topic by creating a subscription. Each message in the system might have many consumer unlike the earlier one. The publishing client has the flexibility of sending the messages to many subscriber clients who are subscribed to the topic.