C# 无法访问指定的终结点

C# 无法访问指定的终结点,c#,.net,rabbitmq,C#,.net,Rabbitmq,从.net应用程序发布消息时,rabbitmq中存在间歇性问题。它在系统中制造了大量噪音。 我尝试过谷歌搜索,但找不到问题的根本原因 这是我在应用程序日志中看到的错误 None of the specified endpoints were reachable Endpoints attempted: ------------------------------------------------ endpoint=amqp-0-9://localhost:5672, attempts=1 Sy

从.net应用程序发布消息时,rabbitmq中存在间歇性问题。它在系统中制造了大量噪音。 我尝试过谷歌搜索,但找不到问题的根本原因

这是我在应用程序日志中看到的错误

None of the specified endpoints were reachable
Endpoints attempted:
------------------------------------------------
endpoint=amqp-0-9://localhost:5672, attempts=1
System.TimeoutException: Connection to amqp-0-9://localhost:5672 timed out
   at RabbitMQ.Client.Impl.SocketFrameHandler_0_9.Connect(TcpClient socket, AmqpTcpEndpoint endpoint, Int32 timeout)
   at RabbitMQ.Client.Impl.SocketFrameHandler_0_9..ctor(AmqpTcpEndpoint endpoint, ObtainSocket socketFactory, Int32 timeout)
   at RabbitMQ.Client.Framing.Impl.v0_9_1.ProtocolBase.CreateFrameHandler(AmqpTcpEndpoint endpoint, ObtainSocket socketFactory, Int32 timeout)
   at RabbitMQ.Client.ConnectionFactory.FollowRedirectChain(Int32 maxRedirects, IDictionary`2 connectionAttempts, IDictionary`2 connectionErrors, AmqpTcpEndpoint[]& mostRecentKnownHosts, AmqpTcpEndpoint endpoint)
================================================
Stack trace:
   at RabbitMQ.Client.ConnectionFactory.CreateConnection(Int32 maxRedirects)
   at RabbitMQ.Client.ConnectionFactory.CreateConnection()

我已通过将RabbitMQ连接对象设置为singleton来解决此问题,以确保重用连接,而不是每次都创建新连接。

您确定代理正在运行吗?您使用的用户名和密码是什么?是的,代理运行良好。我的服务器上运行了另外四个应用程序,问题是只有一个应用程序。您是否只有“远程”应用程序有问题?在这种情况下,可能是防火墙problem@GasRabbitMQ和应用程序位于同一台计算机上。因此,不应该存在防火墙问题。事实上,同样的方法现在运行良好,问题是间歇性的。