我正在为我提供以下信息的经纪人编写amqp 1.0客户端(在.NET中使用rabbitMQ.Client):
我在Visual Studio中开发了以下代码,该代码可以工作(基于Web上的长搜索):
var cf = new ConnectionFactory();
cf.Uri = new Uri("amqps://brokerRemoteHostName:5671");
cf.Ssl.Enabled = true;
cf.Ssl.ServerName = "brokerRemoteHostName";
cf.Ssl.CertPath = @"C:\Users\mahmoud\Documents\certificate_openssl.p12";
cf.Ssl.CertPassphrase = "myPassword";
var connection = cf.CreateConnection();
Run Code Online (Sandbox Code Playgroud)
但是,输出显示异常:
RabbitMQ.Client.Exceptions.BrokerUnreachableException:
None of the specified endpoints were reachable ---> System.IO.IOException:
connection.start was never received
Run Code Online (Sandbox Code Playgroud)
可能是由于网络超时),如图所示.
其中第50行对应于我们创建连接的行.
感谢您对上述错误的帮助.