Verify the resource adapter installation

The installation verification test (IVT) program for the IBM MQ resource adapter is supplied as an EAR file. To use the program, we must deploy it and define some objects as JCA resources.


The installation verification test (IVT) program is supplied as an enterprise archive (EAR) file called wmq.jmsra.ivt.ear. This file is installed with IBM MQ classes for JMS in the same directory as the IBM MQ resource adapter RAR file, wmq.jmsra.rar. For information about where these files are installed, see Installing the IBM MQ resource adapter.

We must deploy the IVT program on the application server. The IVT program includes a servlet and an MDB that tests that a message can be sent to, and received from, an IBM MQ queue. We can use the IVT program to verify that the IBM MQ resource adapter has been correctly configured to support distributed transactions. If we are deploying the IBM MQ resource adapter in an non-IBM application server, IBM Service might ask you to demonstrate the IVT working to validate that the application server is correctly configured.

Before we can run the IVT program, we must define a ConnectionFactory object, a Queue object and possibly an Activation Specification object as JCA resources, and ensure that the application server creates JMS objects from these definitions and binds them into a JNDI namespace. We can choose the properties of the objects to match the host and port settings of our own QueueManager, but the following set of properties is a simple example:
ConnectionFactory object:
channel:              SYSTEM.DEF.SVRCONN
hostName:             localhost
port:                 1550
queueManager:         QM1
transportType:        CLIENT
Queue object:
baseQueueManagerName: QM1
baseQueueName:        TEST.QUEUE
The mechanism used to define the ConnectionFactory, Queue and Activation Specification objects varies depending on the application server. For example, to set these properties within WebSphere Liberty, add the following entries to the application server's server.xml file:
<!-- IVT Connection factory -->
<jmsQueueConnectionFactory connectionManagerRef="ConMgrIVT" jndiName="IVTCF">
   <properties.wmqJms channel="SYSTEM.DEF.SVRCONN" hostname="localhost" port="1550" transportType="CLIENT"/>
</jmsQueueConnectionFactory>
<connectionManager id="ConMgrIVT" maxPoolSize="10"/>

<!-- IVT Queues -->
<jmsQueue id="IVTQueue" jndiName="IVTQueue">
   <properties.wmqJms baseQueueName="TEST.QUEUE"/>
</jmsQueue>

<!-- IVT Activation Spec -->
<jmsActivationSpec id="wmq.jmsra.ivt/WMQ_IVT_MDB/WMQ_IVT_MDB">    
   <properties.wmqJms destinationRef="IVTQueue"
transportType="CLIENT"
queueManager="QM1"
hostName="localhost"
port="1550"
maxPoolDepth="1"/>
</jmsActivationSpec>

By default, the IVT program expects a ConnectionFactory object to be bound in the JNDI namespace with the name jms/ivt/IVTCF and a Queue object to be bound with the name jms/ivt/IVTQueue. We can use different names, but if you do, we must enter the names of the objects on the initial page of the IVT program and modify the EAR file appropriately.

After you have deployed the IVT program, and the application server has created the JMS objects and bound them into the JNDI namespace, we can start the IVT program by completing the following steps.


Procedure

  1. Start the IVT program by entering a URL in the following format into your web browser:
    http://app_server_host: port/WMQ_IVT/
    
    where app_server_host is the IP address or host name of the system on which your application server is running, and port is the number of the TCP port on which the application server is listening. Here is an example:
    http://localhost:9080/WMQ_IVT/
    
    Figure 1 shows the initial page of the IVT program.
    Figure 1. The initial page of the IVT program
  2. To run the test, click Run IVT. Figure 2 shows the page that is displayed if the IVT is successful.
    Figure 2. Page showing the results of a successful IVT
    If the IVT fails, a page like that shown in Figure 3 is displayed. To obtain further information about the cause of the failure, click View Stack Trace.
    Figure 3. Page showing the results of an IVT that failed

Parent topic: Use the IBM MQ resource adapter