'pymqe.error', 'MQGMO wrong size. Given: 112, expected 108'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyMQI |
New
|
Undecided
|
Unassigned |
Bug Description
Nice work for PyMQI. I have successfully tested on Win32 machine (XP,
Python 2.7.2, pymqi-1.
However, when I run it on x64 machine (Windows 2008, Python 2.7.2,
pymqi-1.
wrong size. Given: 112, expected 108'. The error occurs at the line: sTXMsgReply = replyto_
Would you please give me a hand? Is it a bug? Would you please help me to find a workaround? Thanks a lot in
advance.
#------
# Name: module1
# Purpose:
#
# Author: Administrator
#
# Created: 02/04/2012
# Copyright: (c) Administrator 2012
# Licence: <your licence>
#------
# PyMQI
import pymqi, CMQC, sys, uuid
import xml.dom.minidom
def send_receive(
""" Send & reeive MQ Transactions to & from the specified server.
Return: nReturnCode, sReturnMsg, sTXreplyMsg (string) """
try:
# Give qm_name, channel_name, connect_onfo
qmgr = pymqi.connect(
replyto_
# Get the put_queue
put_queue = pymqi.Queue(qmgr, sQueueName)
# Put the request message.
put_mqmd = pymqi.MD()
# Set the MsgType to request.
put_
# Set up the ReplyTo QUeue/Queue Manager (Queue Manager is automatically
# set by MQ).
put_
put_
# Generate a random number in MsgId and CorrelId to ensure transaction
# integrity.
put_
put_
# Set up the put options - must do with NO_SYNCPOINT so that the request
# message is committed immediately.
put_opts = pymqi.PMO(
CMQC.
# Put queue; send TX message
put_
# Set up message descriptor for get.
get_mqmd = pymqi.MD()
# Set the exact same values of MsgId and CorrelId.
get_
get_
# Set up the get options.
get_opts = pymqi.GMO(
CMQC.
CMQC.
# Version must be set to 2 to correlate.
get_
# Tell MQ that we are matching on CorrelId.
get_
# Set the wait timeout of half a second.
get_
# Open the replyto queue and get response message,
replyto_queue = pymqi.Queue(qmgr, replyto_queue_name,
CMQC.
sTXMsgReply = replyto_
except pymqi.MQMIError, e:
return 1, e, None
except:
return 2, sys.exc_info(), None
else:
return 0, 'Successful!', sTXMsgReply
if __name__ == '__main__':
#Give a wafer Id
sWaferId=
#Call TX
tx_
<sht_id>
nReturnCode, sReturnMsg, oTXMsgReply = send_receive(
print nReturnCode, sReturnMsg
print oTXMsgReply
>>>
2 (<class 'pymqe.error'>, error('MQGMO wrong size. Given: 112, expected
108',), <traceback object at 0x0000000002FC9
None
Hi there,
thanks for the nice words and can you please tell me a couple of things?
- What is the exact version of MQ on both systems as returned by the dspmqver command?
- What is the Python version on the systems? For instance, what is the welcome banner when you run the Python shell?
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
This error means there's a version mismatch between PyMQI, the Windows bit-ness and the MQ version so the thing to do is to chase the component that's off.
Also, as an aside, if you're going to process a lot of XML documents, you may want to have a look at http:// lxml.de - this should be at least an order of magnitude faster a toolkit.
Cheers!