Skip to content

Instantly share code, notes, and snippets.

@dsuch
Last active July 25, 2019 12:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsuch/6538775 to your computer and use it in GitHub Desktop.
Save dsuch/6538775 to your computer and use it in GitHub Desktop.
MQ Put - PyMQI
import pymqi
queue_manager = 'QM01'
channel = 'SVRCONN.1'
host = '192.168.1.135'
port = '1434'
queue_name = 'TEST.1'
message = 'Hello from Python!'
conn_info = '{}({})'.format(host, port)
qmgr = pymqi.connect(queue_manager, channel, conn_info)
queue = pymqi.Queue(qmgr, queue_name)
queue.put(message)
queue.close()
qmgr.disconnect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment