Created
April 21, 2015 11:02
-
-
Save dsuch/4e8d3f46f6671a52e9fb to your computer and use it in GitHub Desktop.
PyMQI directly under Zato
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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