我已在我的计算机上安装了Windows Server Service Pack(Service Bus 1.1)(Windows 7 Enterprise SP1 x64)。
我正在使用示例c#代码创建一个简单的消息发送者/接收者,如下所示: http://www.windowsazure.com/en-us/documentation/articles/service-bus-dotnet-advanced-message-queuing/
当我使用默认的TransportType.NetMessaging
时,控制台应用程序运行正常,我可以向队列发送/接收消息。
当我更改配置文件(或代码)以使用TransportType.Amqp
时,控制台应用程序启动并立即获得异常:
An existing connection was forcibly closed by the remote host
(注意:调用messageReceiver.Receive()
方法时会发生这种情况。)
感觉就像阻止防火墙/端口的东西,但Service Bus安装确实成功地为我的防火墙添加了一堆例外,其中包括:
SBHttpsPort [Inbound, Local Address=Any, Remote Address=Any, Protocol=TCP,9355, 9002, 9359, 9002]
Service Bus Gateway [Inbound, Local Address=Any, Remote Address=Any, Protocol=TCP, 9354, 5672, 5671]
Sevice Bus Message Broker [Inbound, Local Address=Any, Remote Address=Any, Protocol=TCP, 9356, 5672, 5671]
Service Bus Resource Provider [Inbound, Local Address=Any, Remote Address=Any, Protocol=TCP, 9359, 5672, 5671]
Service Bus VSS [Inbound, Local Address=Any, Remote Address=Any, Protocol=TCP, 9356, 5672, 5671]
出站规则也有匹配的例外情况。
Service Bus Gateway (out)
Sevice Bus Message Broker (out)
Service Bus Resource Provider (out)
Service Bus VSS (out)
我在公司网络上,因此无法关闭防火墙以查看其功能。
当我查看具有高级安全性的Windows防火墙 - >监控 - >防火墙时,我确实看到了服务总线的入站异常,但我没有看到Service Bus *(out)防火墙异常(这可能是发出?)。
有人可以帮我弄清楚Amqp在我的机器上发生了什么吗?
干杯。
答案 0 :(得分:2)
使用端口5671作为RuntimePort。
如果您使用连接字符串,它应该如下所示:
端点= SB://machine1.contoso.com/ServiceBusDefaultNamespace; StsEndpoint = https://machine1.contoso.com:9355/ServiceBusDefaultNamespace; RuntimePort = 5671; ManagementPort = 9355; WindowsUsername =用户名; WindowsDomain = CONTOSO; WindowsPassword = passssword; TransportType = AMQP