Configure the IBM MQ resource adapter
To configure the IBM MQ resource adapter, you define various Java Platform, Enterprise Edition Connector Architecture (JCA) resources and, optionally, system properties. We must also configure the resource adapter to run the installation verification test (IVT) program. This is important because IBM service might require this program to be run to indicate that any non-IBM application server has been correctly configured.
Before starting
This task assumes that we are already familiar with JMS and IBM MQ classes for JMS. Many of the properties used to configure the IBM MQ resource adapter are equivalent to properties of IBM MQ classes for JMS objects and have the same function.
About this task
Every application server provides its own set of administration interfaces. Some application servers provide graphical user interfaces to define JCA resources, but others require the administrator to write XML deployment plans. It is therefore beyond the scope of this documentation to provide information about how to configure the IBM MQ resource adapter for each application server.
The following steps therefore focus only on what we need to configure. Refer to documentation supplied with the application server for information about how to configure a JCA resource adapter.
Procedure
Define JCA resources in the following categories:
- Define the properties of the ResourceAdapter object. These properties, which represent the global properties of the resource adapter, such as the level of diagnostic tracing, are described in Configuration for ResourceAdapter object properties.
- Define the properties of an ActivationSpec object. These properties determine how an MDB is activated for inbound communication. For more information, see Configure the resource adapter for inbound communication.
- Define the properties of a ConnectionFactory object. The application server uses these properties to create a JMS ConnectionFactory object for outbound communication. For more information, see Configure the resource adapter for outbound communication.
- Define the properties of an administered destination object. The application server uses these properties to create a JMS Queue object or JMS Topic object for outbound communication. For more information, see Configure the resource adapter for outbound communication.
- Optional: Define a deployment plan for the resource adapter. The IBM MQ resource adapter RAR file contains a file called META-INF/ra.xml, which contains a deployment descriptor for the resource adapter. This deployment descriptor is defined by the XML schema at https://xmlns.jcp.org/xml/ns/javaee/connector_1_7.xsd and contains information about the resource adapter and the services that it provides. An application server might also require a deployment plan for the resource adapter. This deployment plan is specific to the application server.
Specify JVM system properties as required:
-
If we are using Transport Layer Security (TLS), specify the locations of the keystore file and truststore file as JVM system properties, as in the following example:
java ... -Djavax.net.ssl.keyStore= key_store_location -Djavax.net.ssl.trustStore=trust_store_location -Djavax.net.ssl.keyStorePassword=key_store_password
These properties cannot be properties of an ActivationSpec or ConnectionFactory object, and you cannot specify more than one keystore for an application server. The properties apply to the whole JVM, and might therefore affect the application server if other applications, running in the application server, are using TLS connections. The application server might also reset these properties to different values. For more information about using TLS with IBM MQ classes for JMS, see Use TLS with IBM MQ classes for JMS. - Optional:
If required, configure the resource adapter to log warning messages to the application
server's standard output log.
The resource adapter logs, warning, and error messages use the same mechanism as the IBM MQ classes for JMS. For more information, see Logging and IBM MQ classes for JMS. This means that, by default, the messages go to a file called mqjms.log. To
configure the resource adapter to additionally log warning messages to the application server's
standard output log, set the following JVM system property for the application server:
-Dcom.ibm.msg.client.commonservices.log.outputName=mqjms.log,stdout
This is the same property as the one that is used to control trace for the IBM MQ classes for JMS. As with IBM MQ classes for JMS, it is possible to use a system property pointing to the jms.config file (see The IBM MQ classes for JMS configuration file). For information on how to set a JVM system property, see the application server documentation.
Configure the resource adapter to run the installation verification test
-
Configure the resource adapter to run the installation verification test (IVT) program supplied
with the IBM MQ resource adapter.
For information about what we need to configure in order to run the IVT program, see Verify the resource adapter installation.
This is important because IBM service might require this program to be run to indicate that any non-IBM application server has been correctly configured.
Important: We must configure the resource adapter before you can run the program.
- Configuration for ResourceAdapter object properties
The ResourceAdapter object encapsulates the global properties of the IBM MQ resource adapter, such as the level of diagnostic tracing. To define these properties, use the facilities of our resource adapter, as described in the documentation supplied with the application server. - Configure the resource adapter for inbound communication
To configure inbound communication, define the properties of one or more ActivationSpec objects. - Configure the resource adapter for outbound communication
To configure outbound communication, define the properties of a ConnectionFactory object and an administered destination object. - Configure the targetClientMatching property for an activation specification
We can configure the targetClientMatching property for an activation specification so that an MQRFH2 header is included on reply messages when request messages do not contain an MQRFH2 header. This means that any message properties that an application defines on a reply message are included when the message is sent. - IBM MQ message-driven bean pause in WebSphere Liberty
The maxSequentialDeliveryFailures property for an activation specification defines the maximum number of sequential message delivery failures to a message-driven bean (MDB) instance that the resource adapter tolerates before pausing the MDB.
Parent topic: Use the IBM MQ resource adapter