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 specific message

Post new topic  Reply to topic
 Getting specific message « View previous topic :: View next topic » 
Author Message
fcotait
PostPosted: Mon May 20, 2002 5:09 am    Post subject: Getting specific message Reply with quote

Acolyte

Joined: 28 Feb 2002
Posts: 63
Location: Sao Paulo - Brazil

How I make the Get of a specific message?

For example, I have 20 messages in a queue and want to remove the first one, fifth and tenth, using the MsgId.

Thanks
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
PeterPotkay
PostPosted: Mon May 20, 2002 7:39 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7716

If you know what the MessagIDs of the messages are (i.e. message #10 on the queue had an ID of ABCDEFG10), then before the put, set the CorrelID in the MQMD to nulls and set the MessagID to ABCDEFG10. This will insure you are only returned a message with that MessageID (message #10).
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
fcotait
PostPosted: Mon May 20, 2002 12:37 pm    Post subject: Reply with quote

Acolyte

Joined: 28 Feb 2002
Posts: 63
Location: Sao Paulo - Brazil

I am using the MsgId and CorrelId. He will be that I am opening the Line correctly?

Return Reason 2033.

Below this part of codigo in Visual Basic

Thanks

---------------------------------------------------------------------------------

MQOD_DEFAULTS od

od.ObjectName = "QM.TEST"
OpenOptions = MQOO_INPUT_AS_Q_DEF
MQOPEN gHcon, od, OpenOptions, gHobj, cCode, Reason

MQGMO_DEFAULTS gmo
MQMD_DEFAULTS md

gmo.Options = MQGMO_NO_WAIT + MQGMO_ACCEPT_TRUNCATED_MSG + MQGMO_SYNCPOINT

md.MsgId = "414D5120514D2E424C412020202020207314E13C72F00000"
md.CorrelId = MQCI_NONE

MQGET gHcon, gHobj, md, gmo, bufLenGet, bufMsgGet, lenMsgGet, cCode, Reason
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
PeterPotkay
PostPosted: Tue May 21, 2002 4:19 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7716

try adding +MQ.MQMO_MATCH_MSG_ID to your gmo.Options

For some reason, my VB app needs to specify this option if I want to match on a MessageID (or CorrelID (MQ.MQMO_MATCH_CORREL_ID)), but my COBOL apps only need to fill in the MSG_ID or CORREL_ID field with what they want to match on.

And insure that there is a message with that ID on the queue that is not expired and is commited if it was MQPUT under syncpoint.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
fcotait
PostPosted: Tue May 21, 2002 12:08 pm    Post subject: Reply with quote

Acolyte

Joined: 28 Feb 2002
Posts: 63
Location: Sao Paulo - Brazil

It did not function. It is a so simple process that I do not know nor what to make, in my applications in C I function

Any idea is coming well
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
nethaji
PostPosted: Tue May 21, 2002 12:40 pm    Post subject: Reply with quote

Apprentice

Joined: 23 Jul 2001
Posts: 26
Location: Virginia

msgID is a byte variable. Looks like you are trying to pass a string to it. Will this be a problem?? try to pass byte value to it.

regards
Subash
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
fcotait
PostPosted: Wed May 22, 2002 9:12 am    Post subject: Reply with quote

Acolyte

Joined: 28 Feb 2002
Posts: 63
Location: Sao Paulo - Brazil

In VB MsgId variable is a String type in CMQB module

Type MQMD
......
MsgId As String * 24 'Message identifier'
.....
End Type

it does not have as to pass an variable of the type Byte.

they alem of this, Byte type in the VB goes of 0 the 255
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
jhalstead
PostPosted: Wed May 22, 2002 11:53 pm    Post subject: Reply with quote

Master

Joined: 16 Aug 2001
Posts: 258
Location: London

I think this has already been answered however in your code sample you're setting the string to "414D5120514D2E424C412020202020207314E13C72F00000" this is 48 characters long. This is the hex representation fo the message ID. You need to set the string to the ascii equivalent of this hex. As you point out MQMD.MsgId is a 24 byte field. Just so you know the first 12 bytes are based on the source queue manager, in this case AMQ QM.BLA, the last 12 bytes are part of a unique sequence number run.

It could be you're on the right track my VB knowledge is limited.

Jamie
Back to top
View user's profile Send private message Send e-mail
MillsPerry
PostPosted: Thu May 23, 2002 9:01 am    Post subject: Reply with quote

Acolyte

Joined: 08 Oct 2001
Posts: 59
Location: ZyQuest, inc.

You need to set MQGMO.MatchOptions to MQMO_MQMO_MATCH_MSG_ID, not MQGMO.Options.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Getting specific message
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.