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 » How to convert MessageID and Corelated ID into Integers

Post new topic  Reply to topic
 How to convert MessageID and Corelated ID into Integers « View previous topic :: View next topic » 
Author Message
VijayGoparaju`
PostPosted: Tue Sep 16, 2008 2:22 am    Post subject: How to convert MessageID and Corelated ID into Integers Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

Hello All,

I have a Requirement. I want to get the corresponding MessageId of a Message and display the number in a Text Box. And also wanto to convert Message Id and Corelated Id into Integers. How to do that?

Please Help me,
Thanks,
Vijay...
Back to top
View user's profile Send private message
Mr Butcher
PostPosted: Tue Sep 16, 2008 2:29 am    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

excellent idea. so the highest integer for a messageid is then
6,2771017353866807638357894232077e+57 -1 (2**192 -1)

have fun with that.
_________________
Regards, Butcher
Back to top
View user's profile Send private message
VijayGoparaju`
PostPosted: Tue Sep 16, 2008 2:32 am    Post subject: Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

I want to retrieve a particular message with that Message Id from the Queue.
Please tell is is possible or not?,
Vijay.
Back to top
View user's profile Send private message
Mr Butcher
PostPosted: Tue Sep 16, 2008 2:35 am    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

read the application programmers guide and application programmers reference, the information you are looking for is in there.
_________________
Regards, Butcher
Back to top
View user's profile Send private message
VijayGoparaju`
PostPosted: Tue Sep 16, 2008 3:31 am    Post subject: Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

Then, Is there no way to retrieve a particular message? MessageId is not working.I am not getting the value of the message in the Message id.
Vijay...
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Sep 16, 2008 4:05 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Mr Butcher wrote:
read the application programmers guide and application programmers reference, the information you are looking for is in there.
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Sep 16, 2008 4:08 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

If you want to display the message id/correlation id, then look at amqsbcg and you can use that code to display the hex value.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
bruce2359
PostPosted: Tue Sep 16, 2008 5:41 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

To get a message with a particular msgid or correlid, search for match options in the Application Programming Reference and Application Programming Guide.

Look at the MQMD (message descriptor) Msgid and correlid fields. These are 24 BYTE fields - not CHAR (character) fields. As such, they don't convert to anything of value (interest), other than being unique (if generated by the qmgr).
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Tue Sep 16, 2008 7:29 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

As has been said, MsgId and CorrelId are both 24 byte fields that contain binary information. They are not converted by MQ like the character fields in the Message Descriptor. If you want a human visible or usable representation, convert them to and from hexadecimal (ie. 48 characters of 0-9 A-F).

Representing them as integers (signed or unsigned) is not very useful as it will be platform dependent. Why were you thinking of doing this?
_________________
Glenn
Back to top
View user's profile Send private message
VijayGoparaju`
PostPosted: Tue Sep 16, 2008 7:44 pm    Post subject: Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

I want to get a particular message from the Queue.If I know the Msg ID and Cord ID i will get that particular message thats why...
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Sep 16, 2008 9:19 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Quote:
I want to get a particular message from the Queue. If I know the Msg ID and Corel ID...

How get a message by msgid AND correlid:

Move the msgid of the message that you want to get to the MQMD_MSGID field of the message descriptor; then move the correlation id of the message you want to get to the MQMD_CORRELID. When you do the next MQGET, you will get the message with that msgid and correlid - but only that message exists in the queue.

This is all documented in the WMQ Application Programming Guide, in a section entitled "Getting a particular message"
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Wed Sep 17, 2008 6:21 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

VijayGoparaju` wrote:
I want to get a particular message from the Queue.If I know the Msg ID and Cord ID i will get that particular message thats why...


No problem. You can copy them to/from the MsgId & CorrelId fields in the message descriptor and 24 byte arrays in your program. No need for integers.
_________________
Glenn
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Sep 18, 2008 6:49 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Quote:
If I know the Msg ID and Correl ID...

It is not usually necessary for a person to know the msgid and/or correlid of a message. IBM suggests that msgid and correlid be used for applications using the request-reply design model.

The request-reply application design model briefly explained:

The usual request-reply model is for program A to put a request message with a unique msgid to a queue; then program B gets the message, composes a reply message, and moves the inbound (from program A) msgid to the outbound reply message correlid, and puts the reply message to the reply-to-queue.

Program A then gets the reply message from the reply-to-queue, compares the msgid in the request message it sent to program B, with the reply from program B. If the msgid = correlid, then it is the reply program A expected.

This is explained in the APG.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
VijayGoparaju`
PostPosted: Fri Sep 19, 2008 1:15 am    Post subject: Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

Problem is solved Thank you very much...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » How to convert MessageID and Corelated ID into Integers
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.