pymqi sample code

Les Smithson lsmithso at NOhare.SPAM.demon.co.uk
Fri Oct 17 18:34:09 EDT 2003


>>>>> "Miranda" == Miranda Evans <mirandacascade at yahoo.com> writes:

    Miranda> I am attempting to locate code fragments from python
    Miranda> scripts that illustrate how to accomplish 2 different
    Miranda> tasks using pymqi

    Miranda> 1) when making a call to MQPUT, want to set 2 different
    Miranda> message descriptor values: - want to set MsgId to
    Miranda> MQMI_NONE - want to set ReplyToQ to a string the contents
    Miranda> of which is the name of the queue in which a subsequent
    Miranda> MQGET will retrieve the message, e.g. "QL.MYREPLY" It
    Miranda> appears as though this would be accomplished in the
    Miranda> constructor of the md() class, but I'm unsure of what the
    Miranda> code would look like to instantiate an instance of the
    Miranda> class with those 2 message descriptor values.

All pymqi argument structures follow the same pattern:
At construction time, you can set options as keywords:

   md = pymqi.md(MsgId = 123, ReplyToQ = "QL.MYREPLY")

After construction, you can set options as dictionary items, keywords,
or attributes:

   md['MsgId' = 123]
   md.set(MsgId = 123)
   md.MsgId = 123
 


    Miranda> 2) according to IBM documentation, when MsgId is
    Miranda> MQMI_NONE on an MQPUT, a unique message identifier is
    Miranda> created and put in the message descriptor; how can the
    Miranda> python script obtain the unique message identifier that
    Miranda> got created?

If you pass a md parameter to MQPUT, its MsgId member will be updated
by the MQPUT call. 

   

    Miranda> thank you.

Sorry for the tardy response.




More information about the Python-list mailing list