Petar Vučetin
Petar Vučetin

Reputation: 3615

Port Configuration

What is a correct port configuration for the Windows (not Azure) Service Bus so that standard azure bindings will work on AppFabric Service Bus?

In the example below I am getting "Unable to reach vm-sbdemo-petar via TCP (9351, 9352) or HTTP (80, 443)" when trying to Open the host.

Configuration for Service Bus (default):

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

Host:

app.config

<system.serviceModel>
      <services>
         <service name = "MyService">
            <endpoint
               address  = "sb://vm-sbdemo-petar/ServiceBusDefaultNamespace/MyService/"
               binding  = "netOnewayRelayBinding"
               contract = "IMyContract"
            />
         </service>
      </services>
   </system.serviceModel>

main

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

Upvotes: 1

Views: 1356

Answers (2)

Abhishek Lal
Abhishek Lal

Reputation: 3231

Service Bus for Windows Server does NOT have support for the Relay feature, this is currently only available on Azure Service Bus. More details at: http://msdn.microsoft.com/en-us/library/jj193022(v=azure.10).aspx

Upvotes: 2

vibhu
vibhu

Reputation: 1695

Try, if there is a proxy involved.

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

Upvotes: 2

Related Questions