Using IBM MQ classes for Java in an OSGi JVM server

Java™ programs running in an OSGi JVM server can use the IBM® MQ classes for Java, provided by IBM MQ, to access IBM MQ. The IBM MQ classes for Java provide a Java variant of the Message Queue Interface (MQI) that allows a CICS® application to put and get messages to queues, using the MQ connection that is maintained by CICS. Support for use of IBM MQ classes for Java in CICS applications is provided from IBM MQ for z/OS® 7.1.

In a CICS environment, the classes supplied by IBM MQ allow only connections to MQ in bindings mode. Any attempt to use connections to a remote queue manager in client mode results in an exception. In bindings mode, the call request is transformed into an IBM MQ MQI call, and is processed as normal by the existing CICS-MQ adapter. The converted requests flow into the CICS-MQ adapter in exactly the same way as MQI requests from any other program (for example, a COBOL program). So there are no operational differences between Java programs and other programs accessing IBM MQ.

To use the IBM MQ classes for Java in your application, you must:
  • Ensure that you have access to the MQ classes for Java in your development environment. Unless you have IBM MQ installed on your workstation, get these from IBM MQ SupportPacs which entitle you to download the IBM MQ clients free of charge.
  • Add your application to a CICS bundle project, export to zFS, and install it into the JVM server.
  • Configure the CICS JVM server environment with the correct levels of the IBM MQ Java and native libraries. These must match the level of IBM MQ libraries that are specified in the CICS STEPLIB. For more information, see Configuring an OSGi JVM server to support IBM MQ classes for Java.

For information about the IBM MQ classes for Java, see Using IBM MQ classes for Java in the IBM MQ documentation. A list of the classes is in IBM MQ classes for JMS JavaDoc in the IBM MQ documentation. For a tutorial, see CICS Developer Center: Using MQ JMS in a CICS OSGi JVM server.