Windows(不是 Azure)服务总线的正确端口配置是什么,以便标准的 azure 绑定可以在 AppFabric 服务总线上工作?
在下面的示例中,我在尝试打开主机时收到“无法通过 TCP (9351, 9352) 或 HTTP (80, 443) 访问 vm-sbdemo-petar”。
服务总线的配置(默认):
HTTPS Port 9355
TCP Port 9354
Message Broker Port 9356
Resource Provider HTTPS Port 9359
Amqp Port 5672
Amqps Port 5671
Internal Communication Port Range 9000 - 9004
主持人:
应用程序配置
<system.serviceModel>
<services>
<service name = "MyService">
<endpoint
address = "sb://vm-sbdemo-petar/ServiceBusDefaultNamespace/MyService/"
binding = "netOnewayRelayBinding"
contract = "IMyContract"
/>
</service>
</services>
</system.serviceModel>
主要的
ServiceHost host = new ServiceHost(typeof(MyService));
host.SetServiceBusCredentials("string");
ConnectionStatusBehavior behavior = new ConnectionStatusBehavior();
behavior.Connecting += OnConnecting;
behavior.Offline += OnOffline;
behavior.Online += OnOnline;
foreach(ServiceEndpoint endpoint in host.Description.Endpoints)
{
endpoint.Behaviors.Add(behavior);
}
host.Open();
Console.WriteLine("Press ENTER to shut down service.");
Console.ReadLine();
host.Close();