我们已经在一个Windows服务应用程序上实现了RabbitMQ,该应用程序将与我们的生产环境中托管的服务器进行通信。
我们已在客户端网络上将我们的域列入白名单,并在我们的服务器上打开了端口5672。
此配置在其中一个客户端网络上正常工作。
但是在另一个客户端网络上,它会导致以下错误
2018-03-22 13:53:35.0673 5 INFO Starting service.
2018-03-22 13:53:38.3566 4 ERROR None of the specified endpoints were reachable Connection failed The requested name is valid, but no data of the requested type was found RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> RabbitMQ.Client.Exceptions.ConnectFailureException: Connection failed ---> System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found
at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
at RabbitMQ.Client.TcpClientAdapter.BeginConnect(String host, Int32 port, AsyncCallback requestCallback, Object state)
at RabbitMQ.Client.Impl.SocketFrameHandler.Connect(ITcpClient socket, AmqpTcpEndpoint endpoint, Int32 timeout)
--- End of inner exception stack trace ---
at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IList`1 endpoints)
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IList`1 endpoints, String clientProvidedName)
--- End of inner exception stack trace ---
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IList`1 endpoints, String clientProvidedName)
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IList`1 hostnames, String clientProvidedName)
at RabbitMQ.Client.ConnectionFactory.CreateConnection()
at MessageQueue.RabittMQ.RabbitMQProperties.CreateConnection()
at MessageQueue.RabittMQ.Consumer..ctor(String queueName)
at MessageQueue.RegisterConsumer()
很明显,RabbitMQ客户端(Windows服务)无法与我们的prod环境中托管的RabbitMQ服务器建立连接,但不确定导致此问题的原因和原因。
我们还需要确保在客户端网络中为IN和OUT绑定连接打开端口5672吗?
我们使用域名(test.server.com)作为RabbiMQ主机名来建立连接。
由于错误说它无法解析DNS,是否需要提供IP地址而不是域名?