Create and configure JMS administered objects

We can use IBM MQ Explorer to configure the JMS administered objects that enable communication between Java applications and IBM MQ.


The Java Message Service (JMS) is a Java API that allows applications that are written in Java to the JMS specification to communicate with any messaging product that implements the JMS API. Because the JMS API is an open standard and has multiple implementations, we can select which messaging provider (the JMS provider) to use according to your requirements.

IBM MQ is a JMS provider; it provides a messaging system that implements the JMS API. We can use the IBM MQ graphical user interface, IBM MQ Explorer, to configure the JMS administered objects that enable communication between the Java application (the JMS client) and IBM MQ (the JMS provider).

There are two types of JMS administered objects in IBM MQ classes for JMS:

  • Connection factories, which the JMS client uses to create connections to the JMS provider.
  • Destinations, which the JMS client uses to represent the target and source of messages.

The administered objects are stored in a naming and directory service that is accessed by IBM MQ Explorer using the Java Naming Directory Interface (JNDI) API. The administered objects are stored in locations on the naming and directory service known as the JNDI namespaces. There are various JNDI service providers that we can use as the naming and directory service, including Lightweight Directory Access Protocol (LDAP) and local or remote file systems.

Because the JMS client uses the JMS administered objects to connect to the JMS provider, you configure the administered objects to define how the JMS client sends and receives, or publishes and subscribes, messages. The JMS client does not directly communicate with the JMS provider and is unaware of which JMS provider is being used. This means that we can change the JMS provider without having to update the JMS client.

To configure IBM MQ classes for JMS so that a JMS client can connect to and access administered objects in a JNDI namespace, you must perform the following tasks in IBM MQ Explorer:


Procedure

  1. Connect to the JNDI namespace. For more information, see Add an initial context.
  2. Create and configure the administered objects that are stored in the JNDI namespace. For more information, see Creating a connection factory and Creating a destination.


Results

For more information about programming JMS applications and configuring IBM MQ classes for JMS, see Use IBM MQ classes for JMS in the IBM MQ online product documentation.