【发布时间】:2016-03-24 07:57:43
【问题描述】:
从 QueueManager 断开连接时,我收到错误代码 2195 的 MQException。我无法找到原因。如何找出此异常的原因?
我的代码如下所示。最后一行是抛出异常。
MQQueueManager qMgr = null;
MQQueue fromQueue = null;
try
{
// mq properties
Hashtable properties = new Hashtable();
properties.Add(MQC.HOST_NAME_PROPERTY, _config.HostName);
properties.Add(MQC.PORT_PROPERTY, _config.Port);
properties.Add(MQC.CHANNEL_PROPERTY, _config.ChannelName);
// managed mode
properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);
// create connection
qMgr = new MQQueueManager(_config.QueueManagerName, properties);
fromQueue = qMgr.AccessQueue(_config.QueueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.Options = MQC.MQGMO_SYNCPOINT | MQC.MQGMO_FAIL_IF_QUIESCING | MQC.MQGMO_WAIT;
gmo.WaitInterval = Convert.ToInt32(timeout.TotalMilliseconds % Int32.MaxValue);
try
{
MQMessage message = new MQMessage();
fromQueue.Get(message, gmo); //wait for message
if (message != null && message.MessageLength > 0)
{
string strMsg = message.ReadString(message.MessageLength);
ret = true;
}
}
catch (MQException ex)
{
if (ex.ReasonCode != MQC.MQRC_NO_MSG_AVAILABLE)
{
throw;
}
}
}
finally
{
try
{
if (fromQueue != null)
fromQueue.Close();
if (qMgr != null)
if(qMgr.IsConnected)
qMgr.Disconnect();
【问题讨论】:
-
您有任何 FDC 文件吗?您使用的是哪个版本的 MQ?
-
我不知道任何 FDC 文件。那些是干什么用的?服务器版本为7.5,客户端版本为8.0.0.4。
-
*.FDC 文件由 MQ 编写,用于记录错误并转储有关 MQ 遇到错误时发生的情况的信息。它们可用于解决问题。