Skip to content

Instantly share code, notes, and snippets.

@dsuch
Created April 21, 2015 11:02
Show Gist options
  • Save dsuch/4e8d3f46f6671a52e9fb to your computer and use it in GitHub Desktop.
Save dsuch/4e8d3f46f6671a52e9fb to your computer and use it in GitHub Desktop.
PyMQI directly under Zato
from zato.server.service import Service
class MyService(Service):
def handle(self):
import pymqi
queue_manager = 'IDM'
channel = 'SYSTEM.AUTO.SVRCONN'
host = '10.1.0.12'
port = '1414'
queue_name = 'TESTEG'
message = 'Hello from Zato!'
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment