现场服务总线1.1SDK(不是Azure Cloud)支持中继吗?
下面的代码在中可以正常工作,但在1.1中不工作。
代码:
ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect;
string serviceNamespace = "ServiceBusDefaultNamespace";
string issuerName = "owner";
string issuerSecret = "[Secret Key Here]";
ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect;
var address = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespace, "EchoService");
var binding = new NetTcpRelayBinding();
var behavior = new TransportClientEndpointBehavior();
binding.Security.Mode = EndToEndSecurityMode.Transport;
binding.Security.RelayClientAuthenticationType = RelayClientAuthenticationType.RelayAccessToken;
behavior.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuerName, issuerSecret);
ServiceHost host = new ServiceHost(typeof(EchoService));
var endpoint = host.AddServiceEndpoint(typeof(IEchoContract), binding, address);
endpoint.Behaviors.Add(behavior);
host.Open();实例化ServiceHost时发生的ServiceHost错误
发布于 2014-05-16 12:57:10
1.1不支持中继,而只支持基于队列的消息传递。
这个问题已经在这里被问到并回答了:Relay binding not working for Window Server Service Bus 1.1
https://stackoverflow.com/questions/21025688
复制相似问题