2013-06-29 114 views
1

什麼是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 

主持人:

的app.config

<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(); 

回答

2

Windows服務器的服務總線不支持中繼功能,目前僅適用於Azure服務總線。更多詳細信息,請訪問:http://msdn.microsoft.com/en-us/library/jj193022(v=azure.10).aspx

+0

您是否知道Windows Service Bus支持哪些WCF綁定? –

+0

我們在Windows Server版本上提供了服務總線隊列和主題,因此這些支持使用netMessagingBinding。可以在這裏找到一個示例:http://code.msdn.microsoft.com/windowsazure/Brokered-Messaging-WCF-0a526451 –

+0

此示例不適用於開箱即用的Windows Service Bus。 –

2

請嘗試,如果有涉及代理。

<system.net> 
<defaultProxy useDefaultCredentials="true"> 
</defaultProxy> 
</system.net> 
+0

感謝Vibhu,但是這都是在單個虛擬機內部運行。 –