.net - How do I browse a Websphere MQ message without removing it? -
I am writing a .NET windows form application that will post a message in a websphere MQ queue and then a separate queue If a response has been returned for a response, the application will partially process the response in real time. But the response needs to be in queue so that the job of a daily batch, which also reads from the response queue, can rest the rest.
I read the message that I could not understand, how it is read without removing it.
Even so far away from me, I am an MQ novice, so any suggestions would be appreciated. And hesitate to respond in C #. MQMessage dim q = ConnectToResponseQueue () Dim msg as the new MQMessage () Dim receives the new MQGetMessageOptions () Dim as the
Public Function GetMessage (ByVal msgID by string) Dim RunThru = Now.AddMilliseconds (CInt (ConfigurationManager.AppSettings ("ResponseTimeoutMS"))) system. threading. Thread Sleep (1000) 'Wait for one second before checking for first reaction' while True Try q.Get (msg, getOpts) Hold the return message as a bout when ex.Reason = MQC.MQRC_NO_MSG_AVAILABLE if now & gt; Android system: Thru (3000) Finally try end and end on q.Close () and return Nothing 'should never reach here' end function
Note: I have not verified that my code actually deletes the message, but how do I understand the MQ to work, and it is happening that is happening. Please correct me that it is not the default behavior.
You must open Qi with the MQOO_BROWSE option, then using the MQGMO_BROWSE_FIRST option on your first reading Do GET. Finally, your subsequent GET should use the MQGMO_BROWSE_NEXT option.
Note: MQOO MQ is the open option and MQGMO's MQ message option.
Comments
Post a Comment