应该为 Azure 服务总线中的 AMQP 连接打开哪些端口?

Which ports should be open for AMQP connection in Azure Service Bus?

我在 AMQP 上找到了关于它使用的端口的文档:

Azure Service Bus requires the use of TLS at all times. It supports connections over TCP port 5671, whereby the TCP connection is first overlaid with TLS before entering the AMQP protocol handshake, and also supports connections over TCP port 5672 whereby the server immediately offers a mandatory upgrade of connection to TLS using the AMQP-prescribed model. The AMQP WebSockets binding creates a tunnel over TCP port 443 that is then equivalent to AMQP 5671 connections.

以及其他 post 中的更多详细信息:

It supports connections over TCP port 5671 and over TCP port 5672. The server immediately offers a mandatory upgrade to TLS using the AMQP-prescribed model. The AMQP WebSockets binding creates a tunnel over TCP port 443 that is then equivalent to AMQP 5671 connections.

我不太明白的是这两个端口有什么区别。两者都应该一直打开,还是只是其中一个是必需的,另一个是一些后备,或者它取决于所使用的库。

P.S。我使用 Microsoft.Azure.ServiceBus 库连接

可在此处找到详细信息。 http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-security-v1.0-os.html#toc

端口 5671 用于纯 TLS 连接(第 5.2.1 节)。据我所知,这实际上是大多数客户现在所做的。

端口 5672 用于纯 TCP 连接和 TLS 升级(第 5.2 节)。

服务总线客户端仅支持端口 5671 上的纯 TLS 连接。如果客户端需要,该服务支持端口 5672 上的 TLS 升级。