Skip navigation links

Jakarta EE Platform API v9.0.0

Package jakarta.jms

The Jakarta Messaging API provides a common way for Java programs to create, send, receive and read an enterprise messaging system's messages.

See: Description

Package jakarta.jms Description

The Jakarta Messaging API provides a common way for Java programs to create, send, receive and read an enterprise messaging system's messages.

Jakarta Messaging Applications

A Jakarta Messaging application is composed of the following parts:

Administration

Jakarta Messaging providers differ significantly in their implementations of underlying messaging technology. There are also major differences in how a Jakarta Messaging provider's system is installed and administered.

For Jakarta Messaging clients to be portable, they must be isolated from these proprietary aspects of a provider. This is done by defining Jakarta Messaging administered objects that are created and customised by a provider's administrator and later used by clients. The client uses them through Jakarta Messaging interfaces that are portable. The administrator creates them using provider-specific facilities.

There are two types of Jakarta Messaging administered objects:

Administered objects are placed by an administrator in a JNDI (Java Naming and Directory Interface) namespace. A Jakarta Messaging client typically notes in its documentation the Jakarta Messaging administered objects it requires and how the JNDI names of these objects should be provided to it.

Two Messaging Styles

Jakarta Messaging supports two styles of messaging:

These two styles represent two of the dominant approaches to messaging currently in use.

Jakarta Messaging APIs

For historical reasons Jakarta Messaging offers four alternative sets of interfaces for sending and receiving messages:

Each API offers a different set of interfaces for connecting to a Jakarta Messaging provider and for sending and receiving messages. However they all share a common set of interfaces for representing messages and message destinations and to provide various utility features.

All interfaces are in the jakarta.jms package.

Interfaces common to multiple APIs

The main interfaces common to multiple APIs are as follows:

Classic API interfaces

The main interfaces provided by the classic API are as follows:

Simplified API interfaces

The simplified API provides the same messaging functionality as the classic API but requires fewer interfaces and is simpler to use. The main interfaces provided by the simplified API are as follows:

Legacy domain-specific API interfaces

Although the domain-specific API remains part of Jakarta Messaging for reasons of backwards compatibility it should be considered to be completely superseded by the classic and simplified APIs.

The main interfaces provided by the domain-specific API for point-to-point messaging are as follows:

The main interfaces provided by the domain-specific API for pub/sub messaging are as follows:

Terminology for sending and receiving messages

The term consume is used in this document to mean the receipt of a message by a Jakarta Messaging client; that is, a Jakarta Messaging provider has received a message and has given it to its client. Since Jakarta Messaging supports both synchronous and asynchronous receipt of messages, the term consume is used when there is no need to make a distinction between them.

The term produce is used as the most general term for sending a message. It means giving a message to a Jakarta Messaging provider for delivery to a destination.

Developing a Jakarta Messaging Application

Broadly speaking, a Jakarta Messaging application is one or more Jakarta Messaging clients that exchange messages. The application may also involve non-Jakarta Messaging clients; however, these clients use the Jakarta Messaging provider's native API in place of the Jakarta Messaging API.

A Jakarta Messaging application can be architected and deployed as a unit. In many cases, Jakarta Messaging clients are added incrementally to an existing application.

The message definitions used by an application may originate with JMS, or they may have been defined by the non-Jakarta Messaging part of the application.

Developing a Jakarta Messaging Client

A typical Jakarta Messaging client using the classic API executes the following Jakarta Messaging setup procedure:

In contrast, a typical Jakarta Messaging client using the simplified API does the following:

At this point a client has the basic Jakarta Messaging setup needed to produce and consume messages.

Package Specification

Jakarta Messaging 2.0 specification

Related Documentation

Jakarta Enterprise Edition Technical Documentation
Skip navigation links

Jakarta EE Platform API v9.0.0

Copyright © 2018,2020 Eclipse Foundation.
Use is subject to license terms.