Python Extension for IBM MQ
Maintained. Last release 7 weeks ago, commits in 6 of the last 26 weeks. Weaker on contributor spread.
$
pip install ibmmqPython library for IBM MQ
-------------------------
The "ibmmq" package is an open-source Python extension for IBM MQ.
It gives a full-featured implementation of the MQI programming interface, with additional
helper functions to assist with system monitoring and management.
Sample code
-----------
To put a message on a queue:
.. code-block:: python
import ibmmq
queue_manager = ibmmq.connect('QM1', 'DEV.APP.SVRCONN', '192.168.1.121(1414)')
q = ibmmq.Queue(queue_manager, 'DEV.QUEUE.1')
q.put('Hello from Python!')
To read the message back from the queue:
.. code-block:: python
import ibmmq
queue_manager = ibmmq.connect('QM1', 'DEV.APP.SVRCONN', '192.168.1.121(1414)')
q = ibmmq.Queue(queue_manager, 'DEV.QUEUE.1')
msg = q.get()
print('Here is the message:', msg)
Many more examples are in the `project repository
<https://github.com/ibm-messaging/mq-mqi-python/tree/main/code/examples/>`_
and in the `dev-patterns repository
<https://github.com/ibm-messaging/mq-dev-patterns/tree/master/Python/>`_.