How it works: IBM MQ classes for JMS with CICS

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.) The IBM MQ classes for JMS can run in an OSGi JVM server, with restrictions, or in a Liberty JVM server.

On the Java EE platform, IBM MQ classes for JMS supports two types of communication between a component of an application and an IBM MQ queue manager:
Outbound communication
Using the JMS API directly, an application component creates a connection to a queue manager, and then sends and receives messages.

For example, the application component can be an application client, a servlet, a JavaServer Page (JSP), an enterprise Java bean (EJB), or a message driven bean (MDB). In this type of communication, the application server container provides only low-level functions in support of messaging operations, such as connection pooling and thread management.

Inbound communication
A message arriving at a destination is delivered to an MDB, which then processes the message.

Java EE applications use MDBs to process messages asynchronously. An MDB acts as a JMS message listener and is implemented by an onMessage() method, which defines how a message is processed. An MDB is deployed in the EJB container of an application server. The precise way in which an MDB is configured depends on which application server you are using, but the configuration information must specify which queue manager to connect to, how to connect to the queue manager, which destination to monitor for messages, and the transactional behavior of the MDB. This information is then used by the EJB container. When a message satisfying the selection criteria of the MDB arrives at the specified destination, the EJB container uses IBM MQ classes for JMS to retrieve the message from the queue manager, and then delivers the message to the MDB by calling its onMessage() method.

IBM MQ classes for JMS in an OSGi JVM server

The following restrictions apply:
  • Using IBM MQ classes for JMS in a CICS OSGi JVM server is only supported in CICS Version 5.2 or later.
  • Client mode connections are not supported.
  • Connections are only supported to queue managers in IBM MQ Version 7.1 or IBM MQ Version 8.0 or later. The PROVIDERVERSION attribute on the connection factory must be either unspecified, or a value greater than, or equal to, 7.
  • Using any of the XA connection factories, for example com.ibm.mq.jms.MQXAConnectionFactory, is not supported.

IBM MQ classes for JMS in a CICS standard-mode Liberty JVM server

A CICS standard-mode Liberty JVM server when the JMS application connects to a queue manager using either bindings mode or client mode connections.
  • The IBM MQ resource adapter can connect to any in-service version of IBM MQ in client mode
  • The IBM MQ resource adapter can connect to any in-service version of IBM MQ for z/OS® in bindings mode when there is no CICS connection (active CICS MQCONN resource definition) to the same queue manager from the same CICS region.

To connect to IBM MQ from Liberty, you need the IBM MQ resource adapter at Version 9.0.1 or later. Liberty does not contain the IBM MQ resource adapter so you must get it from Fix Central (see Installing the resource adapter in Liberty).

CICS Liberty with client connection to external MQ and CHIN, and bindings to MSTR

IBM MQ classes for JMS in a CICS integrated-mode Liberty JVM server

CICS integrated-mode Liberty JVM server when the JMS application connects to a queue manager using only client mode connections.
  • The IBM MQ resource adapter can connect to any in-service version of IBM MQ in client mode.
  • Bindings mode connection is not supported.

To connect to IBM MQ from Liberty, you need the IBM MQ resource adapter at Version 9.0.1 or later. Liberty does not contain the IBM MQ resource adapter so you must get it from Fix Central (see Installing the resource adapter in Liberty).

CICS Liberty with client connections to external MQ and CHIN

Where next?

For information about developing applications with IBM MQ classes for JMS with CICS, see Using IBM MQ classes for JMS in an OSGi JVM server or Using IBM MQ classes for JMS in a Liberty JVM server in the CICS documentation. For information about setting up the JVM server for the applications, see Configuring a Liberty JVM server to support JMS

For information about IBM MQ classes, see Using IBM MQ classes for JMS in the IBM MQ documentation.