通过Pymqi向IBM MQ发送消息时如何设置JMS属性

时间:2019-10-07 09:42:12

标签: python jms ibm-mq

我想在使用pymqi发送消息以支持不同的消息参数时设置一些jms属性。

下面的代码仅供参考

import pymqi

queue_manager = 'QM1'

channel = 'DEV.APP.SVRCONN'

host = '127.0.0.1' 

port = '1414' 

queue_name = 'TEST.1' 

message = 'Hello from Python!' 

conn_info = '%s(%s)' % (host, port) 

qmgr = pymqi.connect(queue_manager, channel, conn_info)

queue = pymqi.Queue(qmgr, queue_name)

queue.put(message)

queue.close()

qmgr.disconnect()

0 个答案:

没有答案