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 your resource adapter, as described in the documentation supplied with your application server.

The ResourceAdapter object has two sets of properties:
  • Properties associated with diagnostic tracing
  • Properties associated with the connection pool managed by the resource adapter

The way in which you define these properties depends on the administration interfaces that your application server provides. If you are using WebSphere® Application Server traditional, see WebSphere Application Server traditional configuration or if you are using WebSphere Application Server Liberty, see WebSphere Application Server Liberty configuration. For other application servers, see the product documentation for your application server.

For more information about defining properties associated with diagnostic trace, see Tracing the IBM MQ Resource Adapter

The resource adapter manages an internal connection pool of JMS connections that are used to deliver messages to MDBs. Table 1 lists the properties of the ResourceAdapter object that are associated with the connection pool.
Table 1. Properties of the ResourceAdapter object that are associated with the connection pool
Name of property Type Default value Description
maxConnections String 50 The maximum number of connections to an IBM MQ queue manager and the maximum number of MDBs deployed.
connectionConcurrency String 1 The maximum number of MDBs to share a JMS connection. Sharing connections is not possible and this property always has the value 1.
reconnectionRetryCount String 5 The maximum number of attempts made by the resource adapter to reconnect to an IBM MQ queue manager if a connection fails.
reconnectionRetryInterval String 300 000 The time, in milliseconds, that the resource adapter waits before trying to reconnect to an IBM MQ queue manager.
startupRetryCount String 0 The default number of times to try and connect a MDB on startup, if the queue manager is not running when the application server is started.
startupRetryInterval String 30 000 The default sleep time between startup connection attempts (in milliseconds).
[V9.0.0.0 Jun 2016]supportMQExtensions [V9.0.0.0 Jun 2016]String [V9.0.0.0 Jun 2016]false [V9.0.0.0 Jun 2016]Reverts the IBM MQ JMS behavior to pre-JMS 2.0 behavior. For more information, see SupportMQExtensions property.
[V9.0.0.0 Jun 2016]nativeLibraryPath [V9.0.0.0 Jun 2016]String [V9.0.0.0 Jun 2016]<empty> [V9.0.0.0 Jun 2016]The path to use to load the IBM MQ JNI library to permit bindings mode connections.

[Windows]On Windows the system path also needs to contain the location of the matching IBM MQ installation.

When an MDB is deployed in the application server, a new JMS connection is created and a conversation started with the queue manager, provided the maximum number of connections specified by the maxConnection property is not exceeded. The maximum number of MDBs therefore equals the maximum number of connections. If the number of deployed MDBs reaches this maximum, any attempt to deploy another MDB fails. If an MDB is stopped, its connection can be used by another MDB.

In general, if many MDBs are to be deployed, you must increase the value of the maxConnections property.

The reconnectionRetryCount and reconnectionRetryInterval properties govern the behavior of the resource adapter when connections to an IBM MQ queue manager fail, because of a network failure for example. When a connection fails, the resource adapter suspends the delivery of messages to all MDBs supplied by that connection for an interval specified by the reconnectionRetryInterval property. The resource adapter then attempts to reconnect to the queue manager. If the attempt fails, the resource adapter makes further attempts to reconnect at intervals specified by the reconnectionRetryInterval property until the limit imposed by the reconnectionRetryCount property is reached. If all attempts fail, delivery is stopped permanently until the MDBs are restarted manually.

In general, the ResourceAdapter object requires no administration. However, to enable diagnostic tracing on UNIX and Linux® systems for example, you can set the following properties:

traceEnabled:    true
traceLevel:      10
These properties have no effect if the resource adapter has not been started, which is the case, for example, when applications using IBM MQ resources are running only in the client container. In this situation, you can set the properties for diagnostic tracing as Java Virtual Machine (JVM) system properties. You can set the properties by using the -D flag on the java command, as in the following example:

java ... -DtraceEnabled=true -DtraceLevel=6

You do not need to define all the properties of the ResourceAdapter object. Any properties left unspecified take their default values. In a managed environment, it is better not to mix the two ways of specifying properties. If you do mix them, the JVM system properties take precedence over the properties of the ResourceAdapter object.

WebSphere Application Server traditional configuration

The same properties are available for the resource adapter in WebSphere Application Server traditional, but they should be set for within the properties panel of the resource adapter (see JMS provider settings in the WebSphere Application Server traditional product documentation. Trace is controlled by the diagnostics section of the WebSphere Application Server traditional configuration. For more information, see Working with Diagnostic Providers in the WebSphere Application Server traditional product documentation.

WebSphere Application Server Liberty configuration

The resource adapter is configured using XML elements in the server.xml file, as shown in the following example:

<featureManager>
...
    <feature>wmqJmsClient-2.0</feature>
...
</featureManager>           
    <variable name="wmqJmsClient.rar.location"
        value="F:/_rtc_wmq8005/_build/ship/lib/jca/wmq.jmsra.rar"/>
...
        <wmqJmsClient supportMQExtensions="true" logWriterEnabled="true"/>
Trace is enabled by adding this XML element:

<logging traceSpecification="JMSApi=all:WAS.j2c=all:"/>