【发布时间】:2021-12-24 14:21:51
【问题描述】:
我正在尝试查找 RabbitMQ 断开连接并且无法重新连接的问题,因此我已将其简化为此代码块以尝试跟踪它,但仍然无法弄清楚。这是一个代码示例
for (int i = 0; i < 100; i++)
{
try
{
currentConnection = factory.CreateConnection();
Console.WriteLine("connected " + i);
currentConnection.Close();
Console.WriteLine("closed " + i);
currentConnection.Dispose();
}
catch (Exception ex)
{
Console.WriteLine("fail " + ex.Message);
}
}
看起来很简单,但这就是我所看到的,我尝试在两个不同的位置使用两台不同的服务器,使用和不使用 TLS,有和没有多个端点/节点,结果是总是一样的,有时它会连接,有时它不会:
connected 0
closed 0
fail None of the specified endpoints were reachable
fail None of the specified endpoints were reachable
connected 3
closed 3
fail None of the specified endpoints were reachable
服务器日志充满了“{handshake_timeout,frame_header}”错误,但我不确定这意味着什么或我可以做些什么不同的事情。
【问题讨论】: