Using IBM MQ classes for JMS/Jakarta Messaging

IBM® MQ classes for JMS and IBM MQ classes for Jakarta Messaging are the Java messaging providers supplied with IBM MQ. As well as implementing the interfaces defined in the JMS and Jakarta Messaging specifications, these messaging providers add two sets of extensions to the Java messaging API.

[MQ 9.3.0 Jun 2022][MQ 9.3.0 Jun 2022][Jakarta Messaging 3.0]From IBM MQ 9.3.0, Jakarta Messaging 3.0 is supported for developing new applications. IBM MQ 9.3.0 continues to support JMS 2.0 for existing applications. It is not supported to use both the JMS 2.0 API and the Jakarta Messaging 3.0 API in the same application.
Note: For Jakarta Messaging 3.0, control of the JMS specification moves from Oracle to the Java Community Process. However, Oracle retains control of the "javax" name, which is used in other Java technologies that have not moved to the Java Community Process. So, while Jakarta Messaging 3.0 is functionally equivalent to JMS 2.0 there are some differences in naming:
  • The official name for version 3.0 is Jakarta Messaging rather than Java Message Service.
  • The package and constant names are prefixed with jakarta rather than javax. For example, in JMS 2.0 the initial connection to a messaging provider is a javax.jms.Connection object, and in Jakarta Messaging 3.0 it is a jakarta.jms.Connection object.

[JMS 2.0]The javax.jms packages define the JMS interfaces, and a JMS provider implements these interfaces for a specific messaging product. IBM MQ classes for JMS is a JMS provider that implements the JMS interfaces for IBM MQ.

[Jakarta Messaging 3.0]The jakarta.jms packages define the Jakarta Messaging interfaces, and a Jakarta Messaging provider implements these interfaces for a specific messaging product. IBM MQ classes for Jakarta Messaging is a Jakarta Messaging provider that implements the Jakarta Messaging interfaces for IBM MQ.

The JMS and Jakarta Messaging specifications expect ConnectionFactory and Destination objects to be administered objects. An administrator creates and maintains administered objects in a central repository, and a JMS or Jakarta Messaging application retrieves these objects using the Java Naming Directory Interface (JNDI).

[JMS 2.0]For JMS 2.0, an administrator can use the IBM MQ JMS administration tool JMSAdmin, or IBM MQ Explorer, to create and maintain administered objects in a central repository.

[Jakarta Messaging 3.0]For Jakarta Messaging 3.0, you cannot administer JNDI using IBM MQ Explorer. JNDI administration is supported by the Jakarta Messaging 3.0 variant of JMSAdmin, which is JMS30Admin.

Because JMS and Jakarta Messaging share much in common, further references to JMS in this topic can be taken as referring to both. Any differences are highlighted as necessary.

IBM MQ classes for JMS also provides two sets of extensions to the JMS API. The main focus of these extensions concerns creating and configuring connection factories and destinations dynamically at run time, but the extensions also provide function that is not directly related to messaging, such as function for problem determination.
The IBM MQ JMS extensions
IBM MQ classes for JMS contains extensions that are implemented in objects such as MQConnectionFactory, MQQueue, and MQTopic objects. These objects have properties and methods that are specific to IBM MQ. The objects can be administered objects, or an application can create the objects dynamically at run time. These extensions are termed the IBM MQ JMS extensions.
The IBM JMS extensions
IBM MQ classes for JMS also provides a more generic set of extensions to the JMS API, which are not specific to IBM MQ as the messaging system or Java as the programming language used. These extensions are termed the IBM JMS extensions and have the following broad objectives:
  • To provide a greater level of consistency across IBM JMS providers.
  • To make it easier to write a bridge application between two IBM messaging systems.
  • To make it easier to port an application from one IBM JMS provider to another.

The extensions provide function that is similar to that provided in IBM MQ Message Service Client (XMS) for C/C++ and IBM MQ Message Service Client (XMS) for .NET.