zpymqi

API reference

Usage

You can set up control blocks in a variety of ways. For example

  gmo = pymqi.GMO() 
  gmo.Options = pymqi.CMQC.MQGMO_WAIT | pymqi.CMQC.MQGMO_FAIL_IF_QUIESCING | pymqi.CMQC.MQPMO_SYNCPOINT 
  gmo.WaitInterval = 1  * 1000 # 1  seconds

or

  gmo = pymqi.GMO(WaitInterval= 1*1000,Options = ....)

To find the names (and values) of all of the fields, you can use the MQ documentation or use the Python statement such as

  print("GMO",gmo)

Some fields are positional, some are keyword=value. If you wish to omit a positional value use None

GMO()

PMO()

OD()

MD()

RFH2()

  add_folder(folder_data)
  byte string = pack(encoding=None)
 () =unpack(buffer,encoding=None) #### TM() #### TMC2() #### CD() #### SCO() #### SD() #### SRO()

CMHO() PD() SMPO() IMPO() XQH() CFH() get() CFBF() CFBS() CFQR() CFIF() CFIL() CFIL64() CFIN() CFIN64() CFSF() CFSL() CFST()

QueueManager

(name=’’, disconnect_on_exit=True,bytes_encoding=default.bytes_encoding, default_ccsid=default.ccsid) connect(name) connect_with_options(name, <cd() <,sco()> <,user=…><,password=…>)

<th width=50%>Method</th> <th width=25%>Parameters</th> <th width=25%>Return value </th> </tr> </tr>
QueueManager (<name=''> <disconnect_on_exit=True,> <,bytes_encoding=default.bytes_encoding> <,default_ccsid=default.ccsid>) String:name qmgr object
begin()
commit()
backout()
connect_with_options(name [, opts=cnoopts][ ,cd=mqcd][ ,sco=mqsco]) )
  • String:name
  • Integer:cnoopts
  • mqcd object:cd
  • mqsco object: sco </td>
queue manager object
connect_tcp_client(name, cd, channel, conn_name, user=None, password=None)

not supported on z/OS</td> </td>

disconnect()
get_handle()
get_debug()
set_debug(value)
get_name()
inquire(attribute) attribute is an integer like pymqi.CMQC.MQCA_Q_MGR_IDENTIFIER value, such as byte string or integer, matching the request. </tr>
put1(qDescm,msg <,md() <,pmo> > )
  • qDesc is either a name or an od() object
  • md is a md() object or None
  • pmo is a pmo() object or None </td></tr> </table> ## Queue <th width=50%>Method</th> <th width=25%>Parameters</th> <th width=25%>Return value </th> </tr> </tr> </tr> </tr> </table> #### get_rfh2 get_rfh2(%lt;max_length=None%gt; close() inquire(attribute) set(attribute,arg) set_handle(queue_handle) get_handle()
    Queue(qmgr() <,od() , < mqoo >>)
    open(qdesc,< open_options)
    • qdesc = queue name or od()</ul></td>
    queue handle object
    put(message<,md()<,pmo()>>)
    • string: message
    • md()
    • pmo</ul></td>
    queue handle object
    put_rfh2(message,md(),(rfh2(),rfh2())
    • ????</ul></td>
    get(<maxLength=None>,<md() <,gmo()>>)
    • string: message
    • md()
    • pmo</ul></td>
    queue handle object
    <th width=50%>Method</th> <th width=25%>Parameters</th> <th width=25%>Return value </th> </tr> </tr> </tr> </tr> </table> #### Subscription
    Topic(queue_manager <, topic_name=None> <,topic_string=None> <,topic_desc=None> <,open_opts=None>)
    open(def open(topic_name=None, topic_string=None, topic_desc=None, open_opts=None)
    • String:topic_name
    • String:topic_string
    • String: topic_desc
    • int:open_opts</ul> </td>
    topic object
    pub(msg <,md() (,pmo>>)
    • byte string:msg
    • pmo:></ul></td>
    pub_rfh2()
    sub(<sd()>,<queuename>)
    • sd:sd
    • qmgr object</u></td>
    close(<options=CMQC.MQCO_NONE>)
    • integer:options</ul></td>
    <th width=50%>Method</th> <th width=25%>Parameters</th> <th width=25%>Return value </th> </tr> Byte string </tr>
    Subscription(queue_manager, sub_desc=None, sub_name=None, sub_queue=None, sub_opts=None, topic_name=None, topic_string=None)
    • qmgr object: queue_manager
    • sub_desc
    • sub_name
    • sub_queue
    • integer:sub_opts
    • String: topic_name </ul> </td> </tr>
    sub(<sd()>,<queuename>)
    • sd:sd
    • qmgr object</u> </td>
    get(max_length=None <md() <,gmo>> )
    • integer:max_length
    • md:
    • gmo: </ul> </td>
    sub(sub_desc=None, sub_queue=None, sub_name=None, sub_opts=None, topic_name=None, topic_string=None)
    close(sub_close_options=CMQC.MQCO_NONE,close_sub_queue=False, close_sub_queue_options=CMQC.MQCO_NONE)
    • integer: sub_close_options
    • Boolean: close_sub_queue
    • Integer: close_sub_queue_options </ul> </td> </tr> </table> ### MessageHandle MessageHandle() set(name,value) get_all_properties() FilterOperator(selector,name) Filter(selector) PCFExecute(name=None, disconnect_on_exit=True, model_queue_name=b'SYSTEM.DEFAULT.MODEL.QUEUE', dynamic_queue_name=b'PYMQPCF.*', command_queue_name=b'SYSTEM.ADMIN.COMMAND.QUEUE', response_wait_interval=5000, convert=False) disconnect() unpack(message) prettify(data) prettifyPCFHeader(data) PCFValue(p1, p2) ByteString(value) connect(queue_manager, user=None, password=None, disconnect_on_exit=True, bytes_encoding=default.bytes_encoding, default_ccsid=default.ccsid): connect(queue_manager, channel=None, conn_info=None, user=None, password=None, disconnect_on_exit=True, bytes_encoding=default.bytes_encoding, default_ccsid=default.ccsid):