How to force Service Bus client to use HTTP?
-
2011年11月8日 10:42
I am trying to setup a prototype using AF SB Queues. I am getting an error message “Could not connect to net.tcp://mjurekdemo.servicebus.windows.net:9354/” – this is expected – firewall issue.
So I want to force QueueClient to use HTTP protocol but despite using “ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.Http;” it still tries to connect using TCP and I am getting the same error.
I am sure HTTP connectivity works fine (e.g. I can create a Queue programmatically).What’s wrong?
Thanks for any hint,
Michael
全部回复
-
2011年11月9日 6:25版主
Hi,
Can you make sure you have set the connection mode before invoking Service Bus?
Best Regards,
Ming Xu.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework -
2011年12月19日 4:37
Hi Michael,
Let's say you are creating service URL with following code -
Uri address = ServiceBusEnvironment.CreateServiceUri("sb", "sampleservicebus", "myservice");
Then you code of setting connectivity mode should be added before previous code -
ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.Http;
When we try to connect service bus using TCP then, it always needs to open some port in firewall. If you are not opening any port in firewall then I don't think it is accepting connections over TCP.
I will be interested to know how you made sure that, connections is happening over TCP only?
Hoep this helps.
Regards,
kunal
Mark As Answer if it helps you | My Blog

