I'm write a new program, and want to connect to queue manager. how do I configure in python program?
Asked
Active
Viewed 205 times
1 Answers
1
PyMQI allows one to connect to queue managers to issue MQAI and PCF requests.
Below code establishes a connection, puts a message on a queue and disconnects.
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()
More details: https://github.com/dsuch/pymqi

Mebin Joe
- 2,172
- 4
- 16
- 22
-
@Kevin.Wu You are welcome. Glad that I could help you. – Mebin Joe Apr 01 '19 at 09:56