Could someone please post some sample code which uses the MQGMO_BROWSE_FIRST and MQGMO_BROWSE_NEXT? I am able to browse the first message in the queue, but I am unable to browse any messages after the first. Thanks!
It would be much easier if you post your code for us to modify it rather than someone supplying you the code for the same. I dont have it right now, else i could have posted it here.
Sorry about not posting the code. Here it is. I get an error (Completion Code=2, ReasonCode=2033, Reason=MQRC_NO_MSG_AVAILABLE) on the second "qQue.Get" statement. It gets the first message successfully, but errors on the second message. Thanks for your help!
Dim qSes As New MQAX200.MQSession()
Dim qMgr As MQAX200.MQQueueManager
Dim qQue As MQAX200.MQQueue
Dim qMsg As MQAX200.MQMessage
Dim qGmo As MQAX200.MQGetMessageOptions
Dim cnt As Int16
Looks like a VB program. I am not a specialist on it, but shall try.
First of all i dont know how it works. Because looking at the program, the Get is being doine outside the for loop, so not sure how you are able to even do the second get.
If it is already in the loop, which i dont see. You need to reset the qMsg.MessageId and qMsg.CorrelationId to MQMI_NONE and MQCI_NONE respectively in your app after you get each message. Because after you get a message, these attributes hold the values from the 1st message. Unless you reset them, MQ searches for the next message with these values.
Thank you very much for your help! I set both the message ID and correlation ID = "" and it worked. I read the constants you provided (MQMI_NONE and MQCI_NONE) are not supported by the MQ Automation Classes for ActiveX, but using the empty string has the same effect.
BTW, the qQue.Get statement is in the for loop, I pasted it incorrectly. Thanks again!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.