ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Getting MQ Message ID back

Post new topic  Reply to topic
 Getting MQ Message ID back « View previous topic :: View next topic » 
Author Message
watt01
PostPosted: Fri Jul 26, 2002 9:40 am    Post subject: Getting MQ Message ID back Reply with quote

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
View user's profile Send private message
kirani
PostPosted: Fri Jul 26, 2002 10:28 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
bduncan
PostPosted: Fri Jul 26, 2002 1:45 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Getting MQ Message ID back
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.