Configuring the resource adapter for inbound communication

To configure inbound communication, define the properties of one or more ActivationSpec objects.

The properties of an ActivationSpec object determine how a message drive bean (MDB) receives JMS messages from a WebSphere® MQ queue. The transactional behavior of the MDB is defined in its deployment descriptor.

An ActivationSpec object has two sets of properties:
  • Properties that are used to create a JMS connection to a WebSphere MQ queue manager
  • Properties that are used to create a JMS connection consumer that delivers messages asynchronously as they arrive on a specified queue
The way in which you define the properties of an ActivationSpec object depends on the administration interfaces provided by your application server.
Table 1 lists the properties of an ActivationSpec object that are used to create a JMS connection to a WebSphere MQ queue manager.
Table 1. Properties of an ActivationSpec object that are used to create a JMS connection
Name of property Type Valid values (default value in bold) Description
applicationName String
  • The invoking class name, if it is available, adjusted to be no longer than 28 characters. If it is not available, the string WebSphere MQ Client for Java is used.
The name by which an application is registered with the queue manager. This application name is shown by the DISPLAY CONN MQSC/PCF command (where the field is called APPLTAG) or in the IBM® WebSphere MQ Explorer Application Connections display (where the field is called App name).
brokerCCDurSubQueue 1 String
  • SYSTEM.JMS.D.CC.SUBSCRIBER.QUEUE
  • A queue name
The name of the queue from which a connection consumer receives durable subscription messages
brokerCCSubQueue 1 String
  • SYSTEM.JMS.ND.CC.SUBSCRIBER.QUEUE
  • A queue name
The name of the queue from which a connection consumer receives nondurable subscription messages
brokerControlQueue 1 String
  • SYSTEM.BROKER.CONTROL.QUEUE
  • A queue name
The name of the broker control queue
brokerQueueManager 1 String
  • "" (empty string)
  • A queue manager name
The name of the queue manager on which the broker is running
brokerSubQueue1 String
  • SYSTEM.JMS.ND.SUBSCRIBER.QUEUE
  • A queue name
The name of the queue from which a nondurable message consumer receives messages
brokerVersion1 String
  • unspecified - After the broker is migrated from V6 to V7, set this property so that RFH2 headers are no longer used. After migration, this property is no longer relevant.
  • V1 - To use a WebSphere MQ publish/subscribe broker. Or to use a broker of WebSphere MQ Integrator, WebSphere Event Broker, WebSphere Business Integration Event Broker, or WebSphere Business Integration Message Broker in compatibility mode. This value is the default value if TRANSPORT is set to BIND or CLIENT.
  • V2 - To use a broker of WebSphere MQ Integrator, WebSphere Event Broker, WebSphere Business Integration Event Broker, or WebSphere Business Integration Message Broker in native mode. This value is the default value if TRANSPORT is set to DIRECT or DIRECTHTTP.
The version of the broker being used
ccdtURL String
  • null
  • A uniform resource locator (URL)
A URL that identifies the name and location of the file containing the client channel definition table (CCDT) and specifies how the file can be accessed
CCSID String
  • 819
  • A coded character set identifier supported by the Java virtual machine (JVM)
The coded character set identifier for a connection
channel String
  • SYSTEM.DEF.SVRCONN
  • The name of an MQI channel
The name of the MQI channel to use
cleanupInterval 1 int
  • 3 600 000
  • A positive integer
The interval, in milliseconds, between background runs of the publish/subscribe cleanup utility
cleanupLevel1 String
  • SAFE
  • NONE
  • STRONG
  • FORCE
  • NONDUR
The cleanup level for a broker-based subscription store
clientID String
  • null
  • A client identifier
The client identifier for a connection
cloneSupport String
  • DISABLED - Only one instance of a durable topic subscriber can run at a time.
  • ENABLED - Two or more instances of the same durable topic subscriber can run simultaneously, but each instance must run in a separate Java virtual machine (JVM).
Whether two or more instances of the same durable topic subscriber can run simultaneously
connectionNameList String
  • localhost(1414)
  • A string composed of items separated by commas where each item takes the format:
    HOSTNAME(PORT)
    where HOSTNAME is either a DNS name or an IP address.

A list of TCP/IP connection names used for inbound communications.

When specified, connectionNameList supersedes the hostname and port properties.

This property is used to reconnect to multi-instance queue managers.

connectionNameList is similar in form to localAddress, but must not be confused with it. localAddress specifies the characteristics of the local communications, whereas connectionNameList specifies how to reach a remote queue manager.

failIfQuiesce Boolean
  • true
  • false
Whether calls to certain methods fail if the queue manager is in a quiescing state
headerCompression String
  • NONE
  • SYSTEM - RLE message header compression is performed
A list of the techniques that can be used for compressing header data on a connection
hostName String
  • localhost
  • A host name
  • An IP address
The host name or IP address of the system on which the queue manager resides.

The hostname and port properties are superseded by the connectionNameList property when it is specified.

localAddress String
  • null
  • A string in the format:
    [host_name][(low_port[,high_port])]
    where host_name is a host name or IP address, low_port and high_port are TCP port numbers, and brackets denote an optional component
For a connection to a queue manager, this property specifies either or both of the following things:
  • The local network interface to be used
  • The local port, or range of local ports, to be used

localAddress is similar in form to connectionNameList, but must not be confused with it. localAddress specifies the characteristics of the local communications, whereas connectionNameList specifies how to reach a remote queue manager.

messageCompression String
  • NONE
  • A list of one or more of the following values separated by blank characters:
    • RLE
    • ZLIBFAST
    • ZLIBHIGH
A list of the techniques that can be used for compressing message data on a connection
messageRetention1 Boolean
  • true - Unwanted messages remain on the input queue
  • false - Unwanted messages are dealt with according to their disposition options
Whether the connection consumer keeps unwanted messages on the input queue
messageSelection 1 String
  • CLIENT
  • BROKER
Determines whether message selection is done by WebSphere MQ classes for JMS or by the broker. Message selection by the broker is not supported when brokerVersion has the value 1.
password String
  • null
  • A password
The default password to use when creating a connection to the queue manager
pollingInterval1 int
  • 5000
  • Any positive integer
If each message listener within a session has no suitable message on its queue, this value is the maximum interval, in milliseconds, that elapses before each message listener tries again to get a message from its queue. If it frequently happens that no suitable message is available for any of the message listeners in a session, consider increasing the value of this property. This property is relevant only if TRANSPORT has the value BIND or CLIENT.
port int
  • 1414
  • A TCP port number
The port on which the queue manager listens.

The hostname and port properties are superseded by the connectionNameList property when it is specified.

providerVersion string
  • unspecified
  • A string in one of the following formats
    • V.R.M.F
    • V.R.M
    • V.R
    • V
    where V, R, M, and F are integer values greater than or equal to zero.
The version, release, modification level and fix pack of the queue manager to which the MDB intends to connect.
queueManager String
  • "" (empty string)
  • A queue manager name
The name of the queue manager to connect to
receiveExit 3 String
  • null
  • A string comprising one or more items separated by commas, where each item is the fully qualified name of a class that implements the WebSphere MQ classes for Java interface, MQReceiveExit
Identifies a channel receive exit program, or a sequence of receive exit programs to be run in succession
receiveExitInit String
  • null
  • A string comprising one or more items of user data separated by commas
The user data that is passed to channel receive exit programs when they are called
rescanInterval1 int
  • 5000
  • Any positive integer
When a message consumer in the point-to-point domain uses a message selector to select which messages it wants to receive, WebSphere MQ classes for JMS searches the WebSphere MQ queue for suitable messages in the sequence determined by the MsgDeliverySequence attribute of the queue. When WebSphere MQ classes for JMS finds a suitable message and delivers it to the consumer, WebSphere MQ classes for JMS resumes the search for the next suitable message from its current position in the queue. WebSphere MQ classes for JMS continues to search the queue in this way until it reaches the end of the queue, or until the interval of time in milliseconds, as determined by the value of this property, has expired. In each case, WebSphere MQ classes for JMS returns to the beginning of the queue to continue its search, and a new time interval commences.
securityExit 3 String
  • null
  • The fully qualified name of a class that implements the WebSphere MQ classes for Java interface, MQSecurityExit
Identifies a channel security exit program
securityExitInit String
  • null
  • A string of user data
The user data that is passed to a channel security exit program when it is called
sendExit 3 String
  • null
  • A string comprising one or more items separated by commas, where each item is the fully qualified name of a class that implements the WebSphere MQ classes for Java interface, MQSendExit
Identifies a channel send exit program, or a sequence of send exit programs to be run in succession
sendExitInit String
  • null
  • A string comprising one or more items of user data separated by commas
The user data that is passed to channel send exit programs when they are called
shareConvAllowed Boolean
  • NO - A client connection cannot share its socket.
  • YES - A client connection can share its socket.
Whether a client connection can share its socket with other top-level JMS connections from the same process to the same queue manager, if the channel definitions match
sparseSubscriptions1 Boolean
  • false - Subscriptions receive frequent matching messages.
  • true - Subscriptions receive infrequent matching messages. This value requires that the subscription queue can be opened for browse.
Controls the message retrieval policy of a TopicSubscriber object
sslCertStores String
  • null
  • A string of one or more LDAP URLs separated by blanks. Each LDAP URL has the format:
    ldap://host_name[:port]
    where host_name is a host name or IP address, port is a TCP port number, and brackets denote an optional component.
The Lightweight Directory Access Protocol (LDAP) servers that hold certificate revocation lists (CRLs) for use on an SSL connection
sslCipherSuite String
  • null
  • The name of a CipherSuite
The CipherSuite to use for an SSL connection
sslFipsRequired 2 Boolean
  • false
  • true
Whether an SSL connection must use a CipherSuite that is supported by the IBM Java JSSE FIPS provider (IBMJSSEFIPS)
sslPeerName String
  • null
  • A template for distinguished names
For an SSL connection, a template that is used to check the distinguished name in the digital certificate provided by the queue manager
sslResetCount int
  • 0
  • An integer in the range 0 - 999 999 999
The total number bytes sent and received by an SSL connection before the secret keys used by SSL are renegotiated
sslSocketFactory String A string representing the fully qualified class name of a class providing an implementation of the javax.net.ssl.SSLSocketFactory interface. Optionally including an argument to be passed to the constructor method, enclosed in parentheses. Any connections established in the scope of the administered object use sockets obtained from this implementation of the SSLSocketFactory interface.
statusRefreshInterval1 int
  • 60000
  • Any positive integer
The interval, in milliseconds, between refreshes of the long running transaction that detects when a subscriber loses its connection to the queue manager. This property is relevant only if subscriptionStore has the value QUEUE.
subscriptionStore 1 String
  • BROKER
  • MIGRATE
  • QUEUE
Determines where WebSphere MQ classes for JMS stores persistent data about active subscriptions
transportType String
  • CLIENT
  • BINDINGS
  • BINDINGS_THEN_CLIENT
Whether a connection to a queue manager uses client mode or bindings mode. If the value BINDINGS_THEN_CLIENT is specified, the resource adapter first tries to make a connection in bindings mode. If this connection attempt fails then the resource adapter tries to make a client mode connection.
username String
  • null
  • A user name
The default user name to use when creating a connection to a queue manager
wildcardFormat String
  • CHAR- Recognizes character wildcards only, as used in broker version 1
  • TOPIC - Recognizes topic level wildcards only, as used in broker version 2
Which version of wildcard syntax is to be used
Notes:
  1. This property can be used with Version 7.0 of WebSphere MQ classes for JMS. It does not affect an application connected to a Version 7.0 queue manager unless the providerVersion property is set to a version number less than 7.
  2. For important information about using the sslFipsRequired property, see Limitations of the IBM WebSphere MQ resource adapter.
  3. For information on how to configure the resource adapter so that it can locate an exit, see Configuring IBM WebSphere MQ classes for JMS to use channel exits.
Table 2 lists the properties of an ActivationSpec object that are used to create a JMS connection consumer.
Table 2. Properties of an ActivationSpec object that are used to create a JMS connection consumer
Name of property Type Valid values (default value in bold) Description
destination String A destination name The destination from which to receive messages. The useJNDI property determines how the value of this property is interpreted.
destinationType String
  • javax.jms.Queue
  • javax.jms.Topic
The type of destination, a queue, or a topic
maxMessages int
  • 1
  • A positive integer
The maximum number of messages that can be assigned to a server session at one time. If the activation spec is delivering messages to an MDB in an XA transaction, a value of 1 is used regardless of the setting of this property.
maxPoolDepth int
  • 10
  • A positive integer
The maximum number of server sessions in the server session pool used by the connection consumer
messageSelector String
  • null
  • An SQL92 message selector expression
A message selector expression specifying which messages are to be delivered
nonASFTimeout int
  • 0
  • A positive integer
A positive value indicates that non-ASF delivery is used. The value is the time, in milliseconds, that a get request waits for messages that might not have yet arrived (a get with wait call). The default value, 0, indicates that ASF delivery is used.

This parameter is valid only when the application is running on WebSphere Application Server version 7 or later.

nonASFRollbackEnabled Boolean
  • false - The message is consumed even if the MDB fails
  • true - Failure within the MDB causes the message to rollback to the queue.
Whether message delivery is within a WebSphere MQ syncpoint if the MDB is non-transacted. Ignored if the MDB is transacted or if nonASFTimeout is set to 0.
poolTimeout int
  • 300000
  • A positive integer
The time, in milliseconds, that an unused server session is held open in the server session pool before being closed due to inactivity
readAheadAllowed int
  • DESTINATION - Determine whether read ahead is allowed by referring to the queue or topic definition.
  • DISABLED - Read ahead is not allowed.
  • ENABLED - Read ahead is allowed.
  • QUEUE - Determine whether read ahead is allowed by referring to the queue definition.
  • TOPIC - Determine whether read ahead is allowed by referring to the topic definition.
Whether the MDB is allowed to use read ahead to get nonpersistent messages from the destination into an internal buffer before receiving them
readAheadClosePolicy int
  • ALL - All messages in the internal read ahead buffer are delivered to the MDB before it stops.
  • CURRENT - Only the current MDB invocation completes, potentially leaving messages in the internal read ahead buffer, which are then discarded.
What happens to messages in the internal read ahead buffer when the MDB is stopped by the administrator.
receiveCCSID int
  • 0 - Use JVM Charset.defaultCharset
  • 1208 - UTF-8
  • A supported coded character set identifier
Destination property that sets the target CCSID for queue manager message conversion. The value is ignored unless receiveConversion is set to QMGR
receiveConversion String
  • CLIENT_MSG
  • QMGR
Destination property that determines whether data conversion is going to be performed by the queue manager.
startTimeout int
  • 10 000
  • A positive integer
The time, in milliseconds, within which delivery of a message to an MDB must start after the work to deliver the message has been scheduled. If this time elapses, the message is rolled back onto the queue.
subscriptionDurability String
  • NonDurable - A nondurable subscription is used to deliver messages to an MDB subscribing to the topic.
  • Durable - A durable subscription is used to deliver messages to an MDB subscribing to the topic.
Whether a durable or nondurable subscription is used to deliver messages to an MDB subscribing to the topic
subscriptionName String
  • "" (empty string)
  • A subscription name
The name of the durable subscription
useJNDI Boolean
  • false - The property called destination is interpreted as the name of a WebSphere MQ queue or a topic.
  • true - The property called destination is interpreted as the name of a javax.jms.Queue object or javax.jms.Topic object in the JNDI namespace of the application server.
Determines how the value of the property called destination is interpreted

The ActivationSpec properties called destination and destinationType must be defined explicitly. All the other properties are optional.

An ActivationSpec object can have conflicting properties. For example, you can specify SSL properties for a connection in bindings mode. In this case, the behavior is determined by the transport type and the messaging domain, which is either point-to-point or publish/subscribe as determined by the destinationType property. Any properties that are not applicable to the specified transport type or messaging domain are ignored.

If you define a property that requires other properties to be defined, but you do not define these other properties, the ActivationSpec object throws an InvalidPropertyException exception when its validate() method is called during the deployment of an MDB. The exception is reported to the administrator of the application server in a manner that depends on the application server. For example, if you set the subscriptionDurability property to Durable, indicating that you want use durable subscriptions, you must also define the subscriptionName property.

If the properties called ccdtURL and channel are both defined, an InvalidPropertyException exception is thrown. However, if you define the ccdtURL property only, leaving the property called channel with its default value of SYSTEM.DEF.SVRCONN, no exception is thrown, and the client channel definition table identified by the ccdtURL property is used to start a JMS connection.

Most of the properties of an ActivationSpec object are equivalent to properties of WebSphere MQ classes for JMS objects or parameters of WebSphere MQ classes for JMS methods. However, three tuning properties, and one usability property, have no equivalents in WebSphere MQ classes for JMS:
startTimeout
The time, in milliseconds, that the work manager of the application server waits for resources to become available after the resource adapter schedules a Work object to deliver a message to an MDB. If this time elapses before delivery of the message starts, the Work object times out, the message is rolled back onto the queue, and the resource adapter can then attempt to deliver the message again. A warning is written to diagnostic trace, if enabled, but does not otherwise affect the process of delivering messages. You might expect this condition to occur only at times when the application server is experiencing a very high load. If the condition occurs regularly, consider increasing the value of this property to give the work manager longer to schedule message delivery.
maxPoolDepth
The maximum number of server sessions in the server session pool used by a connection consumer. When a server session is created, it starts a conversation with a queue manager. The connection consumer uses a server session to deliver a message to an MDB. A larger pool depth allows more messages to be delivered concurrently in high volume situations, but uses more resources of the application server. If many MDBs are to be deployed, consider making the pool depth smaller in order to maintain the load on the application server at a manageable level. Each connection consumer uses its own server session pool, so that this property does not define the total number of server sessions available to all connection consumers.
poolTimeout
The time, in milliseconds, that an unused server session is held open in the server session pool before being closed due to inactivity. A transient increase in the message workload causes additional server sessions to be created in order to distribute the load but, after the message workload returns to normal, the additional server sessions remain in the pool and are not used.

Every time a server session is used, it is marked with a timestamp. Periodically a scavenger thread checks that each server session has been used within the period specified by this property. If a server session has not been used, it is closed and removed from the server session pool. A server session might not be closed immediately after the specified period has elapsed, this property represents the minimum period of inactivity before removal.

useJNDI
For a description of this property, see Table 2.
To deploy an MDB, first define the properties of an ActivationSpec object, specifying the properties that the MDB requires. The following example is a typical set of properties that you might define explicitly:
channel:          SYSTEM.DEF.SVRCONN
destination:      SYSTEM.DEFAULT.LOCAL.QUEUE
destinationType:  javax.jms.Queue
hostName:         192.168.0.42
messageSelector:  color='red'
port:             1414
queueManager:     ExampleQM
transportType:    CLIENT

The application server uses the properties to create an ActivationSpec object, which is then associated with an MDB. The properties of the ActivationSpec object determine how messages are delivered to the MDB. Deployment of the MDB fails if the MDB requires distributed transactions but the resource adapter does not support distributed transactions. For information about how to install the resource adapter so that distributed transactions are supported, see Installation of the WebSphere MQ resource adapter.

If more than one MDB is receiving messages from the same destination, then a message sent in the point-to-point domain is received by only one MDB, even if other MDBs are eligible to receive the message. In particular, if two MDBs are using different message selectors, and an incoming message matches both message selectors, only one of the MDBs receives the message. The MDB chosen to receive a message is undefined, and you cannot rely on a specific MDB receiving the message. Messages sent in the publish/subscribe domain are received by all eligible MDBs.

Inbound poison message handling in the Resource Adapter

In some circumstances, a message delivered to an MDB might be rolled back onto a WebSphere MQ queue. This roll back can happen, for example, if a message is delivered within a unit of work that is then rolled back. A message that is rolled back is delivered again, but a badly formatted message might repeatedly cause an MDB to fail and therefore cannot be delivered. Such a message is called a poison message. You can configure WebSphere MQ so that WebSphere MQ classes for JMS automatically transfers a poison message to another queue for further investigation or discards the message.

For details on how to handle poison messages, see Handling poison messages in IBM WebSphere MQ classes for JMS.