我的 .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);
}
Run Code Online (Sandbox Code Playgroud)
此处,代码在内部使用 IIS 用户 ID(应用程序池用户)与 MQ 连接,因为此代码作为 WCF 服务的一部分运行。
If you run the mqrc utility you can find out what the error code translates to:
$mqrc 2085
2085 0x00000825 MQRC_UNKNOWN_OBJECT_NAME
Run Code Online (Sandbox Code Playgroud)
This means the queue name you are attempting to open does not exist on the queue manager you are connected to.
I noted that the source you posted does not include any code related to opening the queue. You should check that the queue name you are attempting to open does in fact exist on the queue manager you are connecting to.
| 归档时间: |
|
| 查看次数: |
9490 次 |
| 最近记录: |