【发布时间】:2017-12-18 05:39:45
【问题描述】:
我的 .NET 代码可以成功连接并将消息放入远程队列。但是,相同的代码不适用于本地队列。它抛出 2085 错误。应该在代码中设置哪些不同的设置以使其与本地队列一起使用?
这是我的代码:
Hashtable queueProperties = new Hashtable();
queueProperties[MQC.HOST_NAME_PROPERTY] = "10.x.x.x";
queueProperties[MQC.PORT_PROPERTY] = 1451;
queueProperties[MQC.CHANNEL_PROPERTY] = "TST1.TRADE.CHANNEL";
try
{
// Attempt the connection
queueManager = new MQQueueManager("MYQUEUEMANAGER", queueProperties);
strReturn = "Connected Successfully";
}
catch (MQException mexc)
{
// TODO: Setup other exception handling
throw new Exception(mexc.Message
+ " ReasonCode: " + mexc.ReasonCode
+ "\n" + GetReason(mexc.ReasonCode), mexc);
}
这里的代码在内部使用 IIS 用户 ID(应用程序池用户)与 MQ 连接,因为此代码作为 WCF 服务的一部分运行。
【问题讨论】: