在c#中,PUT
不再发送消息,但try catch不会抛出错误。我在客户端上找不到跟踪或错误日志。请告诉我在哪里可以找到变化的线索。
客户端位于Windows 2012服务器上,MQ位于大型机上。
// in class constuctor
try
{
_queueManager = new MQQueueManager(queueManagerName, channelName, connectionName);
_requestQueue = _queueManager.AccessQueue(queueName, MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING); //added | MQC.MQOO_INQUIRE
}
catch (MQException MQexp)
{
Console.WriteLine("Error:" + MQexp.Message);
Console.Read();
}
public string Queue_PutTestMsgs(string message)
{
MQMessage queueMessage = new MQMessage();
MQPutMessageOptions queuePutMessageOptions = new MQPutMessageOptions();
try
{
queueMessage.Format = MQC.MQFMT_STRING;
queueMessage.MessageType = MQC.MQMT_REQUEST;
queueMessage.ReplyToQueueManagerName = _responseQueueManagerName;//added
queueMessage.ReplyToQueueName = _responseQueueName;
queueMessage.WriteString(message);
_requestQueue.Put(queueMessage, queuePutMessageOptions);
}
catch (MQException MQexp)
{
Console.WriteLine("Error:" + MQexp.Message);
Console.Read();
}
return message;
}