我对MQ很陌生,试图在我的机器上进行配置。需要安装MQ,以便我可以使用C#.NET代码在MQ中以消息形式发送/接收XML文件。我在我的机器上安装了IBM WebSphere MQ 9.0版本。据我了解,到目前为止,我需要设置队列管理器,队列和通道来达到此目的。所以我试图在MQ中设置它们。但是,当我尝试运行我的代码时,出现错误“MQRC_NOT_AUTHORIZED”。使用.Net连接到IBM WebSphere MQ会引发错误MQRC_NOT_AUTHORIZED
任何人都可以请指导我设置这些东西,以便通过.NET文件共享的场景将工作?我猜在这种情况下,我的机器上的客户端和服务器都将在本地?在创建Queue,Channel等时有很多参数可供选择,这些参数会让我感到困惑,我想我在我的设置中选择了不正确的定义。
这里是我的.Net代码:
using IBM.WMQ;
using System;
using System.Collections;
namespace MQTest
{
class MQTest
{
public MQQueueManager ConnectMQ()
{
MQQueueManager queueManager;
// Setup connection information
Hashtable queueProperties = new Hashtable();
queueProperties[MQC.HOST_NAME_PROPERTY] = "localhost";
queueProperties[MQC.PORT_PROPERTY] = 1414;
queueProperties[MQC.CHANNEL_PROPERTY] = "QM._TEST.SVRCONN";
try
{
// Attempt the connection
queueManager = new MQQueueManager("QM_TEST", queueProperties);
Console.WriteLine("Connected Successfully");
}
catch (MQException mexc)
{
// TODO: Setup other exception handling
throw new Exception(mexc.Message
+ " ReasonCode: " + mexc.ReasonCode
+ mexc.StackTrace, mexc);
}
// For now, return the queueManager to use in reading/writing messages next
return queueManager;
}
}
}
这里是我的MQ设置的快照:
AMQERR01.LOG在发生错误时有什么内容。 – JoshMc