私は、.NETアプリケーションからAMQP 1.0チャネルを使用してIBM MQ 9.0に接続しようとしています。.Net AMQPクライアント(IBM MQ用)
MQ Lightポータルは現在、Nodejs、ruby、java、およびpythonクライアントのみをサポートしています。 .Net用のMQ Light AMQPクライアントがありますか?
私はAmqpnetliteクライアント
namespace AMQPNetLiteSample
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Start");
//Address addr = new Address("10.58.139.97", 1234, "Username","password", "/", "AMQP");
Address addr = new Address("amqp://10.58.139.97:1234");
Connection con = new Connection(addr);
con.Closed += con_Closed;
Console.WriteLine("Created connection");
Session session = new Amqp.Session(con);
session.Closed += session_Closed;
Console.WriteLine("Created session");
SenderLink link = new SenderLink(session, "sender_12565455877", "/public");
Console.WriteLine("Created link");
var message = new Message();
message.Properties = new Properties();
message.Properties.Subject = "mysamplemsg";
message.ApplicationProperties = new ApplicationProperties();
message.ApplicationProperties["myprop"] = "Hello World";
Console.WriteLine("sending message");
link.Send(message);
}
static void session_Closed(AmqpObject sender, Error error)
{
Console.WriteLine("Session closed");
Console.WriteLine(error.ToString());
}
static void con_Closed(AmqpObject sender, Error error)
{
Console.WriteLine("Connection closed");
Console.WriteLine(error.ToString());
}
}
}
でIBM MQ 9に接続しようとしている。しかし、私は、接続の確立に成功することができませんでした。 SenderLinkを開始するときに、2035 MQRC_NOT_AUTHORIZED例外が発生しています。 しかし、IBM MQ 9.0 Serverのチャネル認証を変更せずに、MQ Light nodejsの例(send.js)で試してみると、AMQPチャネルに接続してメッセージを送信できます。
上記のコードに必要な変更があるかどうかをご提案ください。
他の.Net 1.0 AMQPクライアントとIBM MQとの通信に成功した人はいますか?ここであなたの助けが必要です。ありがとう。
理論上、どのAMQPクライアントでも動作するはずです。 NO_AUTHORIZEDの理由の詳細は、MQキュー・マネージャーのエラー・ログに記載されています。 (AMQERR01.LOG) –