Liberty and the IBM MQ resource adapter
The IBM® MQ resource adapter can be installed into WebSphere® Application Server Liberty WebSphere Application Server 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 you 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 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 Using 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 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 9.0 resource adapter.
Restrictions when using the Liberty features
With Liberty WebSphere Application Server 8.5.5 Fix Pack 2 to WebSphere Application Server 8.5.5 Fix Pack 5 inclusive, only the wmqJmsClient-1.1 feature was available and only JMS 1.1 could be used. Liberty WebSphere Application Server 8.5.5 Fix Pack 6 added the wmqJmsClient-2.0 feature so JMS 2.0 could be used.
- The IBM WebSphere MQ 7.5.0 Fix Pack 6 and later IBM WebSphere MQ 7.5 resource adapter can be used with the wmqJmsClient-1.1 feature only.
- The IBM MQ 8.0.0 Fix Pack 3 and later IBM MQ 8.0 resource adapter can be used with wmqJmsClient-2.0 feature only.
- The IBM MQ 9.0 resource adapter can be used with wmqJmsClient-2.0 feature only.
Restrictions when using generic JCA support
- 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 7.5.0 Fix Pack 6 and later IBM WebSphere MQ 7.5 resource adapters.
- JMS 2.0 and JCA 1.7 must be used only with the IBM MQ 8.0.0 Fix Pack 3 and later IBM MQ 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.
- 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 forwmqJms
. If you do usewmqJms
as the ID, then Liberty is not able to properly load the resource adapter. This is becausewmqJms
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 ofmqJms
for the ID, which is preferred. Do not usewmqJms
.<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 idmqJms
; this is to permit IBM MQ specific classes to be loaded.
Restrictions when tracing using generic JCA support
Tracing, and logging are not integrated within the 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 Liberty, see the WebSphere Application Server Liberty documentation.
- Create a text file named jvm.options.
- Insert the following JVM options to enable tracing, one per line, into this
file:
-Dcom.ibm.msg.client.commonservices.trace.status=ON -Dcom.ibm.msg.client.commonservices.trace.outputName=C:\Trace\MQRA-WLP_%PID%.trc
- To apply these settings to a single server, save jvm.options
at:
To apply these changes to all Liberty, save jvm.options at:${server.config.dir}/jvm.options
This will take effect for all JVMs that do not have a locally defined jvm.options file.${wlp.install.dir}/etc/jvm.options
- Restart the server to enable changes.
This results in trace being written to a trace file called MQRA-WLP_<process identifier>.trc in the directory <path_to_trace_to>.