2016-06-13 41 views
0

在我的服务结构环境中,我想将数据发送到指定的单例实例。如果我用的是创建服务代理功能,我只能用逻辑URL是这样的:如何将数据发送到服务结构中的指定单例实例

var client = ServiceProxy.Create<IServiceInterface>(new Uri(“fabric:/platform/service”), ServicePartitionKey.Singleton, TargetReplicaSelector.RandomInstance); 

TargetReplicaSelector给我只有RandomInstanc选项。随机实例并不适合我。我可以轻松地查找所有可用的单实例在我的环境:

var resolver = ServicePartitionResolver.GetDefault(); var partition = await resolver.ResolveAsync(new Uri(“fabric:/platform/service”), ServicePartitionKey.Singleton, new CancellationToken()); var endpoints 
= partition.Endpoints; 

,但我不能创建我收到端点数据ServiceProxy。

回答