我正在构建一个工具,将消息放入队列并将响应/回复放在另一个(通常是存根队列)上
一切正常,但似乎收到回复消息所需的时间并将存根队列放得比实际长。 `
Try
PublicMQVariable.MQMessage_Reply = New MQMessage
PublicMQVariable.MQMessage_Reply.CorrelationId = PublicMQVariable.MQMessage_Request.MessageId
PublicMQVariable.MQMessage_Reply.MessageType = MQC.MQMT_REPLY
PublicMQVariable.MQGetMessageOptions_Response = New MQGetMessageOptions
PublicMQVariable.MQGetMessageOptions_Response.Options = MQC.MQGMO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING
PublicMQVariable.MQGetMessageOptions_Response.MatchOptions = MQC.MQMO_MATCH_CORREL_ID
PublicMQVariable.MQGetMessageOptions_Response.WaitInterval = PublicMQVariable.MyTimeOut
PublicMQVariable.MyStopwatch = Stopwatch.StartNew()
PublicMQVariable.MQQueue_Reply.Get(PublicMQVariable.MQMessage_Reply, PublicMQVariable.MQGetMessageOptions_Reply)
PublicMQVariable.MyStopwatch.Stop()
PublicMQVariable.MyReplyMessage = PublicMQVariable.MQMessage_Reply.ReadString(PublicMQVariable.MQMessage_Reply.MessageLength)
Catch ex As MQException
MsgBox("MQException: compCode: " & ex.CompCode.ToString() & " Reason: " + ex.Reason.ToString() & " - " & ex.Message)
MQDisconnectAndClose()
Return
End Try
上面的代码只是响应为“get”的部分 秒表说回复是在+/- 2000毫秒内收到的,但当我浏览回复队列时,回复消息仅在大约18秒后出现(看着我的手表并不断浏览队列)
答案 0 :(得分:0)
您是否使用MQExplorer浏览回复消息? MQExplorer具有15秒的预定义刷新间隔。每隔15秒,MQExplorer会刷新视图的内容。它将显示队列中存在的消息,最新的通道状态等。