Configuration of the ResourceAdapter object

The ResourceAdapter object encapsulates the global properties of the IBM® MQ resource adapter. Define these properties using the facilities of your resource adapter.

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 you define these properties depends on the administration interfaces provided by 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).

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.