通过 URI 调用 Service Fabric Actor Service 时找不到 V2Listener
Cant find V2Listener when calling Service Fabric Actor Service by URI
尝试获取演员服务中所有演员的列表时,我收到了 AggregateException。
System.AggregateException: FabricInvalidAddressException: NamedEndpoint 'V2Listener' not found in the address '{"Endpoints":{"V2_1Listener":"LautarosMonster:30006+f87ebfe0-9f5c-435f-ac5a-a62ab13eda5d-132059632019035414-bf7ac379-8bc1-4c52-a5b2-339efc840b5b"}}' for partition 'f87ebfe0-9f5c-435f-ac5a-a62ab13eda5d'
这里我得到了 UserActors:
async public Task<List<string>> GetUserActors()
{
ContinuationToken continuationToken = null;
CancellationToken cancellationToken = new CancellationTokenSource().Token;
List<ActorInformation> activeActors = new List<ActorInformation>();
do
{
var proxy = GetUserActorServiceProxy();
PagedResult<ActorInformation> page = await proxy.GetActorsAsync(continuationToken, cancellationToken);
activeActors.AddRange(page.Items.Where(x => x.IsActive));
continuationToken = page.ContinuationToken;
}
while (continuationToken != null);
return activeActors.Select(aa => aa.ActorId.ToString()).ToList();
}
我很确定我的 URI 命名约定是正确的。这就是我获得 actorServiceProxy
的方式
public IActorService GetUserActorServiceProxy()
{
var proxy = ActorServiceProxy.Create(new Uri("fabric:/ECommerce/UserActorService"), 0);
return proxy;
}
应用程序名称是 "ECommerce",我尝试调用的服务是 "UserActor"
在我调用 proxy.GetActorsAsync
的 PagedResult 行抛出异常
尝试获取演员服务中所有演员的列表时,我收到了 AggregateException。
System.AggregateException: FabricInvalidAddressException: NamedEndpoint 'V2Listener' not found in the address '{"Endpoints":{"V2_1Listener":"LautarosMonster:30006+f87ebfe0-9f5c-435f-ac5a-a62ab13eda5d-132059632019035414-bf7ac379-8bc1-4c52-a5b2-339efc840b5b"}}' for partition 'f87ebfe0-9f5c-435f-ac5a-a62ab13eda5d'
这里我得到了 UserActors:
async public Task<List<string>> GetUserActors()
{
ContinuationToken continuationToken = null;
CancellationToken cancellationToken = new CancellationTokenSource().Token;
List<ActorInformation> activeActors = new List<ActorInformation>();
do
{
var proxy = GetUserActorServiceProxy();
PagedResult<ActorInformation> page = await proxy.GetActorsAsync(continuationToken, cancellationToken);
activeActors.AddRange(page.Items.Where(x => x.IsActive));
continuationToken = page.ContinuationToken;
}
while (continuationToken != null);
return activeActors.Select(aa => aa.ActorId.ToString()).ToList();
}
我很确定我的 URI 命名约定是正确的。这就是我获得 actorServiceProxy
的方式public IActorService GetUserActorServiceProxy() { var proxy = ActorServiceProxy.Create(new Uri("fabric:/ECommerce/UserActorService"), 0); return proxy; }
应用程序名称是 "ECommerce",我尝试调用的服务是 "UserActor"
在我调用 proxy.GetActorsAsync
的 PagedResult 行抛出异常