我很难理解如何使用服务总线在同一 URI 上的 2 个不同主机上托管相同的服务。本质上,这就是我们托管服务的方式。
try
{
uri = ServiceBusEnvironment.CreateServiceUri(UriSchemeSb, this.serviceBusDescriptor.ServiceNamespace, servicePath);
host = new ServiceHost(serviceType);
host.AddServiceEndpoint(interfaceType, this.relayBinding, uri);
AddSharedSecretServiceBusCredentialBehavior(host, this.serviceBusDescriptor.IssuerName, this.serviceBusDescriptor.IssuerKey);
this.host.Open();
}
catch (SecurityTokenException exception)
{
this.host.Abort();
this.host = null;
}
可能有两个主机具有相同的 servicePath,并且两个服务都托管在相同的 URI 上。
我以为会抛出一些异常,但似乎并非如此。我是否误解了某些东西,或者它是预期行为在托管的每个服务的 URI 中都有一个新生成的 guid?
除了在托管服务之前测试 URI 之外还有什么建议吗?