Configuring a Liberty JVM server to support IBM MQ classes for JMS

A JVM server is the runtime environment for Java™ applications. You can configure a CICS® Liberty JVM server to support applications that use IBM® MQ classes for JMS.

Procedure

  1. Add the wmqJmsClient-2.0 feature to the server.xml file.
    If you want to perform a JNDI lookup, then you must also add the jndi-1.0 feature.
    <featureManager>
        <feature>wmqJmsClient-2.0</feature>
        <feature>jndi-1.0</feature>
    </featureManager>

    Adding the wmqJmsClient-2.0 feature enables the Liberty server to load the necessary IBM MQ bundles that lets you define the IBM MQ JMS resources. For example, the connection factory and activation specification properties provide client libraries to connect to the IBM MQ network.

  2. If you are configuring JMS applications to connect in the BINDINGS mode, then add the zosTransaction-1.0 feature:
    <featureManager>
        <feature>zosTransaction-1.0</feature>
    </featureManager>
  3. Specify the location of the IBM MQ Resource Adapter by adding the following entry to the server.xml file:
    <variable name="wmqJmsClient.rar.location" value="/path/to/wmq/rar/wmq.jmsra.rar"/>

    The value attribute specifies the absolute path to the IBM MQ Resource Adapter file, wmq.jmsra.rar . Obtain the wmq.jmsra.rar file and install it from Fix Central.

  4. Add the connection factory definitions to the server.xml file.
    • For a CLIENT mode connection, add the following elements:
      <jmsConnectionFactory jndiName="jms/wmqCF" connectionManagerRef="ConMgr6">
          <properties.wmqJms transportType="CLIENT"
              hostName="localhost" port="1414"
              channel="SYSTEM.DEF.SVRCONN" queueManager="QM1"/>
      </jmsConnectionFactory>
      
      <connectionManager id="ConMgr6" maxPoolSize="2"/>
    • For a BINDINGS mode connection, add the following elements:
      <jmsConnectionFactory jndiName="jms/qm1" connectionManagerRef="ConMgr6">
          <properties.wmqJms transportType="BINDINGS" queueManager="QM1"/>
      </jmsConnectionFactory>
      
      <connectionManager id="ConMgr6" maxPoolSize="2"/>
  5. Add the queue definitions to the server.xml:
    <jmsQueue id="jms/queue1" jndiName="jms/queue1">
        <properties.wmqJms baseQueueName="QUEUE1" baseQueueManagerName="QM1"/>
    </jmsQueue>
  6. If you are configuring JMS applications to connect in the BINDINGS mode, use the wmqJmsClient element in the server.xml file to specify the location of the IBM MQ native libraries.
    <wmqJmsClient nativeLibraryPath="/opt/mqm/java/lib64"/>
    To allow the JMS applications to connect by using BINDINGS mode to IBM MQ , you must have both Liberty and IBM MQ deployed on the same server.
  7. If you are using message-driven beans add the mdb-3.2 feature to server.xml:
    <featureManager>
        <feature>mdb-3.2</feature>
    </featureManager>
    • For a CLIENT mode connection, add a jmsActivationSpec element as follows:
      <jmsActivationSpec id="MQ.JMS.mdb.app/MQ.JMS.mdbEJB/MessageDrivenBean">
          <properties.wmqJms transportType="CLIENT"
              destinationRef="jms/queue1" destinationType="javax.jms.Queue"
              hostName="localhost" port="1414"
              channel="SYSTEM.DEF.SVRCONN" queueManager="qm1"/>
      </jmsActivationSpec>
    • For a BINDINGS mode connection, add a jmsActivationSpec element as follows:
      <jmsActivationSpec id="MQ.JMS.mdb.app/MQ.JMS.mdbEJB/MessageDrivenBean">
          <properties.wmqJms transportType="BINDINGS"
              destinationRef="jms/queue1" destinationType="javax.jms.Queue"
              queueManager="qm1"/>
      </jmsActivationSpec>

Results

You have configured a CICS Liberty JVM server to support applications that use IBM MQ classes for JMS.