Creating and configuring JMS administered objects

About this task

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, you can select which messaging provider (the JMS provider) to use according to your requirements.

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

There are two types of JMS administered objects in IBM WebSphere 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 WebSphere MQ Explorer using the Java Naming and 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 you 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 you can change the JMS provider without having to update the JMS client.

To configure IBM WebSphere 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 WebSphere MQ Explorer:

Procedure

  1. Connect to the JNDI namespace. For more information, see Adding 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 WebSphere MQ classes for JMS, see Using Java in the IBM online IBM WebSphere MQ product documentation.