The application on the receiving end is assumed to have been written in Java using MQ JMS API. This allows for seamless integration with Java JMS WMQ systems - from their point of view Zato, despite being written in Python, will appear to be a Java application.
The message is first published on the Zato broker off of which the connector process responsible for communication with this particular queue manager picks it up and actually sends it to the remote queue.
Before making using of the connections, PyMQI needs to be first manually enabled by administrators.
Uses an outgoing connection of a given name to send a JMS message to a WebSphere MQ queue manager.
Optional parameters, if not given, take values from the connection template, which in turn uses default values Spring Python provides and these are in accordance with the JMS spec.
1 2 3 4 5 6 7 8 9 10 11 12
from zato.server.service import Service class MyService(Service): def handle(self): # Request parameters msg = 'Hello MQ!' out_name = 'Customer Cases' queue = 'CUSTOMER.CASES.1' # Send the message to a queue manager self.outgoing.jms_wmq.send(msg, out_name, queue)
When caught travelling over the wire the raw bytes sent across to the queue manager can be confirmed to be a JMS message indeed.
RFH \x00\x00\x00\x02\x00\x00\x00\xa0\x00\x00\x01\x11\x00\x00\x04\xb8 MQSTR \x00\x00\x00\x00\x00\x00\x04\xb8\x00\x00\x00x <jms><Dst>queue:///CUSTOMER.CASES.1</Dst><Tms>1367515530623</Tms><Dlv>1</Dlv> <Exp>1367515535623</Exp><Pri>5</Pri></jms> Hello MQ!