[英]How to configure python program connect QUEUE MANAGE?
我正在編寫一個新程序,並想連接到隊列管理器。 我如何在python程序中配置?
PyMQI允許連接到隊列管理器以發出 MQAI 和 PCF 請求。
下面的代碼建立連接,將消息放入隊列並斷開連接。
import pymqi
queue_manager = 'QM01'
channel = 'SVRCONN.1'
host = 'host.domain.com'
port = '1434'
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()
更多詳情: https : //github.com/dsuch/pymqi
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.