I amd trying put a string message in MQ using pymqi, the code is as follows;
import xml.dom.minidom as minidom
import pymqi
class PutMQ:
def put_mq(args1):
doc = minidom.parse(args1)
queue_manager = "NameQueueManager"
channel = "ChannelName"
host = "HostName"
port = "PortNumber"
conn_info = "%s(%s)" % (host, port)
qmgr = pymqi.QueueManager(None)
qmgr.connectTCPClient(queue_manager, pymqi.cd(), channel, conn_info)
putq = pymqi.Queue(qmgr, 'QueueName')
putq.put(doc.toprettyxml())
putq.close()
qmgr.disconnect()
put_mq('C://MQ//myMessage.xml')
When I run this code, it doesn't throw any error. Hence, I get the feeling that the message has been put successfully on the required Queue.
However, I am expecting to see a record in one of my application screen after I send the above message to the Queue, and this is not happening.
If I put the same message through AppWatch (web interface), it works and I see the expected record on the application UI too.
On the AppWatch (web interface), when I do the 'Put Message', I mention the message type as : "String Format (MQFMT_STRING)".
How can I specify in my code that the message format is 'MQFMT_STRING'?
Appreciate your help on this.