When a WebSphere MQ messaging provider queue or topic is migrated from WebSphere Application Server Version 6.1 or earlier, asynchronous puts are enabled unexpectedly when receiving messages from the queue or topic. Asynchronous puts are enabled regardless of the default asynchronous put behaviour for the queue configured in the WebSphere MQ queue manager (this is specified by the queue attribute DEFPRESP). Asynchronous puts are also enabled unexpectedly when receiving messages from WebSphere MQ messaging provider queues and topics created using AdminConfig. Specifically, when MQQueue and MQTopic configuration objects are created without sendAsync being explicity set. The expected default of "As for queue definition" or "As for topic definition" is applied when the administrative console is used to create a WebSphere MQ JMS Queue or Topic object. The expected default is also applied when using the createWMQQueue and createWMQTopic commands, with AdminTask. The createWMQQueue and createWMQTopic commands should be used, in preference to performing AdminConfig actions directly, for all scripts developed for WebSphere Application Server Version 7.0.
The most likely symptom is delivery of messages without the JMS correlation identifier being set in the message object.
There are other scenarios where enabling read ahead is undesirable, as described in the Using asynchronous put topic of the WebSphere MQ Version 7 information center.
The default value for the sendAsync property of the MQQueue and MQTopic configuration classes is "YES". This default is documented in the WebSphere Application Model Documentation, in the web/configDocs subdirectory of a WebSphere Application Server Version 7.0 installation.
However, the documented default of WebSphere MQ messaging provider queues and topics created with the administrative console, or using the createWMQQueue and createWMQTopic commands, is "As per queue definition" or "As per topic definition". The administrative console, and the createWMQQueue and createWMQTopic commands, write a value of "QUEUE_DEFINED" to the sendAsync property of the MQQueue or MQTopic object they create.
Resolving The Problem
Change the "Asynchronously send messages to the queue manager" Advanced property setting for all WebSphere MQ messaging provider queues and topics to "As for queue definition" or "As for topic definition" in the administrative console.
Alternatively, paste the below example Jython script into a file called setDefaultSendAsync.py, and execute it as follows:
- UNIX, Linux and z/OS platforms:
PROFILE_ROOT/bin/wsadmin.sh -conntype none -lang jython -f /path/to/setDefaultSendAsync.py
PROFILE_ROOT\bin\wsadmin.bat -conntype none -lang jython -f d:\path\to\setDefaultSendAsync.py
# Build a list of all WMQ queue and topic objects
oList = ;
# Iterate through all valid objects in the list
for o in oList:
if o != '':
# Modify the object to set the default read ahead
AdminConfig.modify(o, '[[sendAsync QUEUE_DEFINED]]');
print "Set default sendAsync for " + o;
# Save the changes
15 June 2018