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
-
Add the
wmqJmsClient-2.0feature 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.0feature 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. -
If you are configuring JMS applications to connect in the BINDINGS
mode, then add the
zosTransaction-1.0feature:<featureManager> <feature>zosTransaction-1.0</feature> </featureManager> -
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 thewmq.jmsra.rarfile and install it from Fix Central. -
Add the connection factory definitions to the
server.xmlfile.- 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"/>
- For a CLIENT mode connection, add the following elements:
-
Add the queue definitions to the
server.xml:
<jmsQueue id="jms/queue1" jndiName="jms/queue1"> <properties.wmqJms baseQueueName="QUEUE1" baseQueueManagerName="QM1"/> </jmsQueue> -
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.
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.<wmqJmsClient nativeLibraryPath="/opt/mqm/java/lib64"/> -
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
jmsActivationSpecelement 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
jmsActivationSpecelement 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>
- For a CLIENT mode connection, add a