pymqi sample code

M

Miranda Evans

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.
 
L

Les Smithson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,269
Messages
2,571,338
Members
48,028
Latest member
chasetony

Latest Threads

Top