小编Rab*_*ser的帖子

.NET System.IO.IOException中的rabbitMQ.Client:从未收到过connection.start,可能是由于网络超时

我正在为我提供以下信息的经纪人编写amqp 1.0客户端(在.NET中使用rabbitMQ.Client):

  • amqps:// brokerRemoteHostName:5671
  • certificate_openssl.p12
  • 证书的密码为字符串"mypassword"
  • 队列名称

我在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行对应于我们创建连接的行.

感谢您对上述错误的帮助.

asp.net ssl amqp

6
推荐指数
1
解决办法
2185
查看次数

标签 统计

amqp ×1

asp.net ×1

ssl ×1