1 out of 1 rated this helpful - Rate this topic

ConnectivityMode Enumeration

Describes the connectivity mode.

Namespace:  Microsoft.ServiceBus
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)
public enum ConnectivityMode
Member name Description
Http HTTP mode. Listeners create an HTTP connection with the Service Bus service and poll for messages. This might allow you to more easily work around TCP port constraints.
Tcp TCP mode (default). Listeners create TCP connections with the Service Bus service through port 828 (SSL).
AutoDetect Auto-detect mode. Automatically selects between the TCP and HTTP modes based on an auto-detection mechanism that probes whether either connectivity option is available for the current network environment. If both are available, the system will choose TCP by default.

Service Bus supports only Full Trust code access security.

When using a Service Bus WCF binding, the default connection mode between the listener service and the Service Bus is TCP. However, you might be operating in a network environment that does not allow any outbound TCP connections beyond HTTP. In this case, you can configure the corresponding binding to use a more aggressive connection mode that causes the receiver to establish an HTTP connection with the Service Bus for retrieving relayed messages. Alternatively, you might choose to allow WCF to automatically determine whether to use TCP or HTTP for the connection to the receiver. If both are available, WCF defaults to TCP.

You set the one-way connectivity mode at the AppDomain-level through ServiceBusEnvironment. ServiceBusEnvironment provides a SystemConnectivity property where you can specify one of the three.

The following code illustrates how to modify an Service Bus application to use the HTTP connectivity mode through the ServiceBusEnvironment.

ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.Http;
ServiceHost host = new ServiceHost(typeof(OnewayService), address);
host.Open();
Did you find this helpful?
(1500 characters remaining)