Configuring an OSGi JVM server to support IBM MQ classes for Java

An OSGi JVM server can be configured to support Java™ applications that use IBM® MQ classes for Java to exchange messages with IBM MQ.

Before you begin

Review the considerations in Using IBM MQ classes for Java in an OSGi JVM server.

Set up the CICS®-MQ adapter. For more information, see Setting up the CICS-MQ adapter.

Locate the IBM MQ install directory on zFS.

About this task

IBM MQ classes for Java are a set of Java classes that provide an object model that maps directly to the IBM MQ object model.

This task configures an OSGi JVM server to use the IBM MQ classes for Java to exchange messages with IBM MQ.

CICS connects to IBM MQ through the CICS-MQ adapter.

The IBM MQ classes for Java OSGi bundles must be added to the OSGi JVM server as a set of middleware bundles, and the IBM MQ classes for Java native libraries must be added to the OSGi JVM server library path.

Procedure

  1. Add the IBM MQ classes for Java native libraries to the JVM profile in the LIBPATH_SUFFIX option.

    The IBM MQ classes for Java native libraries are stored in the IBM MQ install directory in zFS, in the java/lib directory.

    LIBPATH_SUFFIX=/usr/lpp/mqm/V9R4M0/java/lib/
  2. Add the IBM MQ classes for Java as middleware bundles to the JVM profile in the OSGI_BUNDLES option.

    The IBM MQ classes for Java are stored in the IBM MQ install directory, in the java/lib/OSGi directory. The bundles com.ibm.mq.osgi.allclientprereqs_version.jar and com.ibm.mq.osgi.allclient_version.jar must be added to as middleware bundles.

    For more information, see Support for OSGi with IBM MQ classes for Java.

    OSGI_BUNDLES=/usr/lpp/mqm/V9R4M0/java/lib/OSGi/com.ibm.mq.osgi.allclientprereqs_9.4.0.10.jar,\
    /usr/lpp/mqm/V9R4M0/java/lib/OSGi/com.ibm.mq.osgi.allclient_9.4.0.10.jar
  3. Start the OSGi JVM server.

Results

The OSGi JVM server is configured to use the IBM MQ classes for Java.

Example

Example JVM profile configuring IBM MQ classes for Java in an OSGi JVM server.
LIBPATH_SUFFIX=/usr/lpp/mqm/V9R4M0/java/lib/
OSGI_BUNDLES=/usr/lpp/mqm/V9R4M0/java/lib/OSGi/com.ibm.mq.osgi.allclientprereqs_9.4.0.10.jar,\
/usr/lpp/mqm/V9R4M0/java/lib/OSGi/com.ibm.mq.osgi.allclient_9.4.0.10.jar

What to do next

Use the IBM MQ classes for Java to exchange messages with IBM MQ in Java applications. For more information, see Using IBM MQ classes for Java in an OSGi JVM server.