LibraryLink ToToggle FramesPrintFeedback

JMS Basics

Java Message Service (JMS) is a Java Message Oriented Middleware (MOM) API for sending messages between two or more clients.

If you are unfamiliar with JMS, you may want to read the Java Message Service API section of Sun Microsystems' J2EE 1.4 Tutorial

A JMS system is comprised of the following components:

  • Providers

  • Messages

  • Clients

  • Destinations

The JMS provider is a messaging system that implements the JMS interfaces. Message broker such as Apache ActiveMQ and FUSE Message Broker are examples of providers.

A messages is an object that contains the data being transferred between JMS clients.

A client is an application that uses the services of the message broker. There are two types of client in a JMS system:

Destinations are maintained by the message broker. They can be either queues or topics.

A queue is a destination that contains messages that have been sent and are waiting to be read. Messages are delivered in the order sent.A message is removed from the queue once it has been read.

Queues are used for point-to-point or one-to-one messaging.


Topics are used to send messages to one or more consumers. Producers publish messages to a topic and one or more consumers subscribe to the topic

In this one-to-many messaging scenario, producers are also referred to as publishers and consumers as subscribers.