【问题标题】:Cant find V2Listener when calling Service Fabric Actor Service by URI通过 URI 调用 Service Fabric Actor Service 时找不到 V2Listener
【发布时间】:2019-11-07 09:38:43
【问题描述】:

尝试获取演员服务中所有演员的列表时,我得到了一个 AggregateException。

System.AggregateException: FabricInvalidAddressException: NamedEndpoint 'V2Listener' not found in the address '{"Endpoints":{"V2_1Listener":"LautarosMonster:30006+f87ebfe0-9f5c-435f-ac5a-a62ab13eda5d-132059632019035414-bf7ac379-8 4c52-a5b2-339efc840b5b"}}' 用于分区 '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 行上引发了异常

【问题讨论】:

    标签: azure azure-service-fabric actor service-fabric-actor


    【解决方案1】:

    【讨论】:

    • 是的!我昨晚才看到。我尝试了建议的解决方案并使用了“IActorService serviceProxy = ServiceProxy.Create(new Uri(serviceUris[i]), new ServicePartitionKey(partitionKey));”反而。我不再收到错误消息,但另一方面它也没有返回任何演员。它始终为零。即使我只是在每次运行此代码时添加一些演员,也只是为了有一些测试演员。
    猜你喜欢
    • 2019-04-07
    • 2016-03-11
    • 2018-01-11
    • 2017-09-02
    • 2016-02-22
    • 2016-08-12
    • 2017-07-19
    • 1970-01-01
    • 2021-04-12
    相关资源
    最近更新 更多