CICS and IBM MQ

CICS® provides a number of ways to run work in CICS using IBM® MQ messages. From Java™ applications, you can access IBM MQ through IBM MQ classes for Java or IBM MQ classes for JMS. From other applications, you can access IBM MQ through two interfaces that are supplied with CICS: the CICS-MQ adapter and the CICS-MQ bridge.

For a summary of the concepts and architecture of IBM MQ on z/OS®, see IBM MQ for z/OS concepts in the IBM MQ product documentation in the IBM MQ documentation. To check which versions of IBM MQ work with CICS, see System requirements for IBM MQ and look under the z/OS entry for the relevant release of IBM MQ.

How CICS works with IBM MQ

CICS provides two resources in support for IBM MQ:
  • MQCONN for defining the attributes of the CICS-MQ connection
  • MQMONITOR for defining the attributes of an IBM MQ message consumer.

The resources are described in more detail in CICS resources for MQ support: MQCONN and MQMONITOR.

Accessing IBM MQ through the CICS-MQ adapter

The CICS-MQ adapter is supplied with CICS and communicates with IBM MQ as an external resource manager using the CICS Resource Manager Interface (RMI). It is often known as the trigger monitor because it allows you to initiate user transactions in CICS through the MQ message trigger mechanism. You can put a message to an application queue that is enabled for triggering. When the message releases the trigger, IBM MQ sends a trigger message to CICS to initiate the specified user transaction. The CICS-MQ adapter provides two main facilities:
  • A set of control functions for use by system programmers and administrators to manage the adapter.
  • Message Queue Interface (MQI) support for CICS applications.

The CICS-MQ adapter uses standard CICS command-level services where required; for example, EXEC CICS ASSIGN and EXEC CICS ABEND. Part of the CICS-MQ adapter runs under the control of the transaction that issues the messaging requests. Therefore, these calls for CICS services look as though they are issued by the transaction.

In a CICS multi-region operation or inter-system communication (ISC) environment, each CICS address space can have its own attachment to the queue manager subsystem. A single CICS address space can connect to only one queue manager at a time. However, each address space can connect to a queue manager subsystem.

For more information, see How it works: the CICS-MQ adapter.

Accessing IBM MQ through the CICS-MQ bridge

The CICS-MQ bridge is supplied with CICS. It allows direct access from IBM MQ applications to applications on your CICS system, by sending a message that contains the name of the target program to an IBM MQ queue. Unlike MQ triggering, the CICS-MQ bridge provides direct access to MQ-unaware CICS applications. When you use the CICS-MQ bridge to run a program or transaction on CICS, the CICS program contains no IBM MQ calls because the bridge enables implicit Message Queue Interface (MQI) support. Therefore, you can re-engineer legacy CICS applications to be controlled from other operating systems by IBM MQ messages, without having to rewrite, recompile, or relink them. The IBM MQ messages include the IBM MQ CICS information header (the MQCIH structure) to supply control options for the CICS applications.

The following types of CICS application are suitable for use with the CICS-MQ bridge:
  • CICS programs that are called by the EXEC CICS LINK command, known as Distributed Program Link (DPL) programs. The programs must conform to the DPL subset of the CICS API; that is, they must not use CICS terminal or sync point facilities. You can use the CICS-MQ bridge to run a single CICS program, or a set of CICS programs that form a unit of work.
  • CICS transactions that were designed to be run from a 3270 terminal, known as 3270 transactions. The transactions can use Basic Mapping Support (BMS) or terminal control commands. They can be conversational or part of a pseudoconversation. They are permitted to issue sync points.

For more information, see About the CICS-WebSphere MQ bridge.

Accessing IBM MQ from a Java application

A Java application that runs in CICS can access IBM MQ through two interfaces:
  • Using IBM MQ classes for JMS.
  • Using IBM MQ classes for Java
The Java application connects to IBM MQ in either of the following ways:
  • In MQ client mode, as an IBM MQ MQI client by using TCP/IP
  • In MQ bindings mode, connecting directly to IBM MQ by using the Java Native Interface (JNI).

For more information, see Accessing IBM MQ from Java applications. For details about the IBM MQ communication types, see Connection modes for IBM MQ classes for JMS in the IBM MQ product documentation.

IBM MQ classes for JMS

Java Message Service (JMS) is an API defined by the Java Enterprise Edition (Java EE) specification that allows applications to send and receive messages using reliable, asynchronous communication. It provides the ability to use a range of messaging providers including IBM MQ, the WebSphere® Liberty-embedded JMS messaging provider or a third party messaging provider. IBM MQ classes for JMS implement the interfaces that are defined in the javax.jms package, and also provides two sets of extensions to the JMS API. Both Java™ Platform, Standard Edition (Java SE) and Java Platform, Enterprise Edition (Java EE) applications can use IBM MQ classes for JMS.

From Version 8.0, IBM MQ supports the JMS 2.0 version of the JMS standard. This implementation offers all the features of the classic API but requires fewer interfaces and is simpler to use. For more information, see The JMS model in the IBM MQ documentation and the JMS 2.0 specification at Java.net.

The IBM MQ classes for JMS can be used in:
  • An OSGi JVM server, with restrictions.
  • A CICS standard-mode Liberty JVM server when the JMS application connects to a queue manager, using either bindings mode or client mode transport.
  • A CICS integrated-mode Liberty JVM server when the JMS application connects to a queue manager, using client mode transport.

New applications should use the IBM MQ classes for JMS rather than IBM MQ classes for Java.

See How it works: IBM MQ classes for JMS with CICS for more details, including the types of communication and the restrictions.

IBM MQ classes for Java
IBM MQ classes for Java provide a Java variant of the IBM Message Queue Interface (MQI) for use by Java applications that run in CICS. A call request to IBM MQ is transformed into an MQI call, and is processed as normal by the existing CICS-MQ adapter. The converted requests flow into the CICS-MQ adapter in 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 that access IBM MQ.

The IBM MQ classes for Java can be used only in an OSGi JVM server. Although existing applications that use the IBM MQ classes for Java continue to be fully supported, new applications should use the IBM MQ classes for JMS.

For more information, see Using IBM MQ classes for Java in an OSGi JVM server .