gpt4 book ai didi

Azure 服务总线示例 "No connection could be made because the target machine actively refused it"

转载 作者:行者123 更新时间:2023-12-03 04:47:29 24 4
gpt4 key购买 nike

我正在尝试运行从 http://www.microsoft.com/download/en/details.aspx?id=17691 下载的 Azure 服务示例 (MessagingWithQueue) .

但是,我收到此错误消息:

Could not connect to net.tcp://xxxx.servicebus.windows.net:9354/. The connection attempt lasted for a time span of 00:00:00.0615234. TCP error code 10061: No connection could be made because the target machine actively refused it.

我正在公司网络内运行该应用程序。服务总线是否需要打开某些防火墙端口?

谢谢。

最佳答案

弗兰克的答案可能是正确的,但今天的答案有点简单。如果您无法访问 AMQP 端口 5671(因为安全性要求严格),那么您可以告诉 ServiceBusClient 使用端口 443 使用 AMQP-over-WebSockets。

var sbcOptions = new ServiceBusClientOptions() { TransportType = ServiceBusTransportType.AmqpWebSockets };
var client = new ServiceBusClient(namespace, credential, sbcOptions);

https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-faq

关于Azure 服务总线示例 "No connection could be made because the target machine actively refused it",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7453319/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com