Liberty and the IBM MQ resource adapter

The IBM MQ resource adapter can be installed into WebSphere Application Server Liberty Version 8.5.5, Fix Pack 2 or later, by using either the wmqJmsClient-1.1 or wmqJmsClient-2.0 feature, depending on which version of the resource adapter you are installing. Alternatively we can, subject to some restrictions, install the resource adapter by using generic Java Platform, Enterprise Edition Connector Architecture (Java EE JCA) support.


General restrictions when installing the resource adapter into Liberty

The following restrictions apply to the resource adapter when using either the wmqJmsClient-1.1 or wmqJmsClient-2.0 feature and also when using generic JCA support:

  • The IBM MQ classes for Java are not supported in Liberty. They must not be used with either the IBM MQ Liberty messaging feature or with the generic JCA support. For more information, see Use WebSphere MQ Java Interfaces in J2EE/JEE Environments.
  • The IBM MQ resource adapter has a transport type of BINDINGS_THEN_CLIENT. This transport type is not supported within the IBM MQ Liberty messaging feature.
  • Before IBM MQ Version 9.0, the Advanced Message Security (AMS) feature was not included in the IBM MQ Liberty messaging feature. However, AMS is supported with an IBM MQ Version 9.0 resource adapter.


Restrictions when using the Liberty features

With Liberty Version 8.5.5, Fix Pack 2 to Version 8.5.5, Fix Pack 5 inclusive, only the wmqJmsClient-1.1 feature was available and only JMS 1.1 could be used. Liberty Version 8.5.5, Fix Pack 6 added the wmqJmsClient-2.0 feature so JMS 2.0 could be used.

However, the feature that you must use depends on which version of the resource adapter you are using:

  • The IBM WebSphere MQ Version 7.5.0, Fix Pack 6 and later Version 7.5 resource adapter can be used with the wmqJmsClient-1.1 feature only.
  • The IBM MQ Version 8.0.0, Fix Pack 3 and later Version 8.0 resource adapter can be used with wmqJmsClient-2.0 feature only.
  • The IBM MQ Version 9.0 resource adapter can be used with wmqJmsClient-2.0 feature only.


Restrictions when using generic JCA support

If you are using generic JCA support, the following restrictions apply:

  • You must specify the level of JMS when using the generic JCA support:

    • JMS 1.1 and JCA 1.6 must be used only with the IBM WebSphere MQ Version 7.5.0, Fix Pack 6 and later Version 7.5 resource adapters.
    • JMS 2.0 and JCA 1.7 must be used only with the IBM MQ Version 8.0.0, Fix Pack 3 and later Version 8.0 resource adapters.
  • It is not possible to run the IBM MQ resource adapter on z/OSĀ® using generic JCA support. In order to run the IBM MQ resource adapter on z/OS, it must be run with the wmqJmsClient-1.1 or wmqJmsClient-2.0 feature.
  • Tracing, and logging are not integrated within the WebSphere Liberty trace system. Instead, the IBM MQ resource adapter trace must be enabled using either Java system properties, or an IBM MQ classes for JMS configuration file, as described in Tracing IBM MQ classes for JMS applications. For details about how to set Java system properties in WebSphere Liberty, see the WebSphere Liberty documentation.For example, in order to enable trace of the IBM MQ resource adapter in WebSphere Liberty 19.0.0.9, add the following entry to the WebSphere Liberty file jvm.options:
    -Dcom.ibm.msg.client.commonservices.trace.status=ON
    -Dcom.ibm.msg.client.commonservices.trace.outputName=C:\Trace\MQRA-WLP_%PID%.trc
    This results in trace being written to a trace file called MQRA-WLP_<process identifier>.trc in the directory C:\Trace.
  • The location of the resource adapter is specified by using the following xml element:
    <resourceAdapter id="mqJms" location="${server.config.dir}/wmq.jmsra.rar">
      <classloader apiTypeVisibility="spec, ibm-api, api, third-party"/>        
    </resourceAdapter> 
    Important: The value of the ID tag can be anything EXCEPT for wmqJms. If you do use wmqJms as the ID, then Liberty is not able to properly load the resource adapter. This is because wmqJms is the ID that is used internally to refer to the specific feature for IBM MQ. It actually creates a NullPointerException. The following examples show some snippets from a server.xml file:
    <!-- Enable features -->    
      <featureManager>       
        <feature>servlet-3.1</feature>     
        <feature>jndi-1.0</feature>    
        <feature>jca-1.7</feature>      
        <feature>jms-2.0</feature>   
      </featureManager>
    Tip: Note the use of the jca-1.7 and jms-2.0 features and the lack of the wmqJmsClient-2.0 feature.
    <resourceAdapter id="mqJms" location="${server.config.dir}/wmq.jmsra.rar">
      <classloader apiTypeVisibility="spec, ibm-api, api, third-party"/>        
    </resourceAdapter> 
    Tip: Note the use of mqJms for the ID, which is preferred. Do not use wmqJms.
    <application id="WMQHTTP" location="${server.config.dir}/apps/WMQHTTP.war" 
    name="WMQHTTP" type="war">    
        <classloader apiTypeVisibility="spec, ibm-api, api, third-party" 
    classProviderRef="mqJms"/>    
    </application>
    Tip: Note the classloaderProviderRef back to the resource adapter through the id mqJms; this is to permit IBM MQ specific classes to be loaded.