Skip navigation links

Package com.adaptris.core.jms.wmq

WebsphereMQ specific JMS implementations of VendorImplementation.

See: Description

Package com.adaptris.core.jms.wmq Description

WebsphereMQ specific JMS implementations of VendorImplementation.

In version 6.0 of WebSphere MQ and previous you may have to install APAR IY81774 which introduces a system property activateExceptionListener that should be set when starting the adapter.

If this property is set, all exceptions resulting from a broken connection are sent to the exception listener, regardless of the context in which they occur. If this is not set, then broken connections may not trigger the standard javax.jms.ExceptionListener interface which means the adapter is not notified of a broken connection to WebsphereMQ and subsequently cannot recover from a broken connection to WebsphereMQ.

By default, all JMS clients to MQ Series will create what is known as an MQRFH2 Header that will form part of the Websphere MQ message. This is used to store (amongst other things) some of the JMS headers that you wanted to preserve using MessageTypeTranslatorImp.setMoveJmsHeaders(Boolean), and all the custom JMS properties that you may have chosen to preserve from AdaptrisMessage metadata by configuring com.adaptris.core.jms.MessageTypeTranslatorImp#setMoveMetadata(Boolean) to be true.This means that the message format internally within WebpshereMQ is MQRFH2 and not MQSTR format. Accordingly the receiving application needs to be able to parse MQRFH2 headers which may not be possible.

If the MQRFH2 Header/format is not required or you need to change the message type to MQSTR, then you need to tell MQSeries to omit the MQRFH2 Header; this will mean that you'll lose all the JMS properties that are mapped into MQRFH2 as standard by MQSeries and also any custom JMS Properties that you might be sending. To omit the MQRFH2 header, then you need to add ?targetClient=1 after the queue name in your ProduceDestination implementation. For example, if the queue that you need to produce to is called SampleQ1 then the string you need to use is queue:///SampleQ1?targetClient=1. More information about the mapping of JMS messages onto MQ Messages can be found at this link

More generally speaking, the more powerful form of specifying a destination using uniform resource identifiers (URIs) is preferred. This form allows you to specify remote queues (queues on a queue manager other than the one to which you are connected). It also allows you to set the other properties contained in a com.ibm.mq.jms.MQQueue object. The URI for a queue begins with the sequence queue://, followed by the name of the queue manager on which the queue resides. This is followed by a further /, the name of the queue, and optionally, a list of name-value pairs that set the remaining Queue properties. For example: queue://Some_Other_Queue_Manager/SampleQ1?key1=value1&key2=value2. If you don't specify a queue manager in the URI then it is interpreted to be the queue manager to which you are currently connected to e.g. queue:///SampleQ1?key1=value1&key2=value2).

Various name value pairs can be used as part of the URI; these include, but is not limited to (some of these values may have a direct correlation to standard JMS headers, if you specify both, then behaviour is dependent on the order of precedence that WebsphereMQ specifies) :

Property Description Values
CCSID Character set of the destination integers - valid values listed in base WebSphere MQ documentation
encoding How to represent numeric fields An integer value as described in the base WebSphere MQ documentation
expiry Lifetime of the message in milliseconds 0 for unlimited, positive integers for timeout (ms) - This might interfere with any TTL value you configure in the producer.
multicast Sets multicast mode for direct connections -1=ASCF, 0=DISABLED, 3=NOTR, 5=RELIABLE, 7=ENABLED
persistence Whether the message should be hardened to disk 1=non-persistent, 2=persistent, -1=QDEF (use the queue definition)
priority Priority of the message 0 through 9, -1=QDEF (use the queue definition)- This might interfere with any priority value you configure in the producer.
targetClient Whether the receiving application is JMS compliant 0=JMS, 1=MQ
Skip navigation links