|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Getting MQ Message ID back |
« View previous topic :: View next topic » |
Author |
Message
|
watt01 |
Posted: Fri Jul 26, 2002 9:40 am Post subject: Getting MQ Message ID back |
|
|
Newbie
Joined: 03 Jun 2002 Posts: 6
|
Hello everyone,
I have a quick question. I have a MQClient application which connects to a Server and puts messages using MQPUT. How do I get the MQ Message ID for the message just put using MQPUT?
Any help on this will be greatly appreciated.
Thanks in advance!!!
 |
|
Back to top |
|
 |
kirani |
Posted: Fri Jul 26, 2002 10:28 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
After your MQPut call, message descriptor is returned back to you with generated values for few fields. You could refer to the same in your code following MQPUT call. For example,
Code: |
MQMD md = {MQMD_DEFAULT};
...
MQPUT(Hcon, /* connection handle */
Hobj, /* object handle */
&md, /* message descriptor */
&pmo, /* default options (datagram) */
count, /* message length */
buffer, /* message buffer */
&CompCode, /* completion code */
&Reason); /* reason code */
|
Use md.MsgId to refer to generated MsgID.... _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
bduncan |
Posted: Fri Jul 26, 2002 1:45 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
The specifics depend of course upon which programming language you are using, but the MQI API always provides a way for accessing the MsgId after an MQPUT. This is usually accomplished by probing the same variable/object that you would have populated with a number had you wished to create the MsgId yourself. Kirani is showing the correct way to retrieve this value with C, and like I said, the process is similar in most other languages... _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|