pymqi sample code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Miranda Evans

    pymqi sample code

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

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

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

    thank you.
  • Les Smithson

    #2
    Re: pymqi sample code

    >>>>> "Miranda" == Miranda Evans <mirandacascade @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.

    Comment

    Working...