Accessing IBM MQ from Java programs

Java™ programs that run in CICS® can use either the IBM® MQ classes for Java, or the IBM MQ classes for JMS, to access IBM MQ. IBM MQ classes for JMS are the preferred interfaces to IBM MQ from a Java application that runs in CICS. (The IBM MQ classes for Java continue to be supported but newer applications should use IBM classes for JMS.

For an overview of how CICS works with IBM MQ, see CICS and IBM MQ.

IBM MQ classes for Java encapsulate the Message Queue Interface (MQI), the native IBM MQ API. The classes use a similar object model to the C++ and .NET interfaces to IBM MQ. In addition, you can exploit the full range of features of IBM MQ beyond the features that are available through JMS. IBM MQ classes for JMS implement the JMS interfaces for IBM MQ as the messaging system.

Three different JVM server environments in CICS support access to the IBM MQ classes:
  • A CICS integrated-mode Liberty JVM server. This JVM server supports IBM MQ classes for JMS. It provides managed JMS connection factories and MDB support, and integrated CICS transactions and security. IBM MQ classes for Java are not supported.
  • A CICS standard-mode Liberty JVM server. This JVM server supports IBM MQ classes for JMS. It provides managed JMS connection factories and MDB support but without integrated CICS transactions. IBM MQ classes for Java are not supported.
  • An OSGi JVM server. This JVM server supports IBM MQ classes for JMS. It supports non-managed JMS connection factories with integrated CICS transactions and security. IBM MQ classes for Java are also supported, in bindings-mode only.
In addition, there are three different ways of connecting to IBM MQ from CICS:
  • MQ client mode: a TCP/IP network connection to an IBM MQ queue manager
  • MQ bindings mode: a local cross memory interface to the queue manager, using the IBM MQ RRS adapter
  • CICS-MQ adapter and MQCONN: a local cross memory interface to the queue manager, using the CICS-MQ adapter

Table 1 shows which JVM servers support which IBM MQ classes, and through which connectivity options.

Table 1. Summary of CICS support for access to IBM MQ from a Java application
MQ connectivity CICS standard-mode Liberty JVM server CICS integrated-mode Liberty JVM server OSGi JVM server
Client mode
  • IBM MQ classes for JMS: JMS 1.1 and JMS 2.0
  • IBM MQ classes for Java: not supported
For more information, see Using IBM MQ classes for JMS in a CICS Liberty JVM server
  • IBM MQ classes for JMS: JMS 1.1 and JMS 2.0
  • IBM MQ classes for Java: not supported
For more information, see Using IBM MQ classes for JMS in a CICS Liberty JVM server
Not supported
Bindings mode
  • IBM MQ classes for JMS: JMS 1.1 and JMS 2.0
  • IBM MQ classes for Java: not supported
For more information, see Using IBM MQ classes for JMS in a CICS Liberty JVM server
Not supported
  • IBM MQ classes for JMS: not supported
  • IBM MQ classes for Java: supported
For imore nformation, see Using IBM MQ classes for Java in an OSGi JVM server
CICS-MQ adapter and MQCONN Not applicable Not applicable
  • IBM MQ classes for JMS: JMS 1.1 and JMS 2.0
  • IBM MQ classes for Java: not supported
For information, see Using IBM MQ classes for JMS in an OSGi JVM server