0

我在本地 servicefabric 集群上有一个演员,当我的无状态服务完成工作时,我尝试将其删除。我使用 RemotingListenerVersion.V2。

  var actor = ActorServiceProxy.Create(new Uri($"{_applicationName}/{_actorServiceName}"), actorId);
              await actor.DeleteActorAsync(actorId, CancellationToken.None);

然后我收到一个异常:

{"NamedEndpoint 'V2Listener' 在地址 '{\"Endpoints\":{\"\":\"my-localhost.pl:30004+ea7448c4-2a32-4c48-8ac9-cb23b6bd6269-131849397597858002-a68d72c7-2387 中找不到-4390-8170-49b38127c0d1\"}}' 用于分区 'xxxx-xxx-xxxx-8ac9-cb23b6bd6269'"}

我的演员清单:

<StatefulServiceType ServiceTypeName="ActorServiceActorServiceType" HasPersistedState="true">
      <Extensions>
        <Extension Name="__GeneratedServiceType__" GeneratedId="c0c20ebd-xxx-xxx-xxx-ebaa99dce8ed|Persisted">
          <GeneratedNames xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
            <DefaultService Name="xxxActorService" />
            <ReplicatorEndpoint Name="xxxxActorServiceActorServiceReplicatorEndpoint" />
            <ReplicatorConfigSection Name="xxxxActorServiceReplicatorConfig" />
            <ReplicatorSecurityConfigSection Name="xxxxxActorServiceActorServiceReplicatorSecurityConfig" />
            <StoreConfigSection Name="xxxxxActorServiceActorServiceLocalStoreConfig" />
            <ServiceEndpointV2 Name="xxxxxActorServiceActorServiceEndpointV2" />
            <ServiceEndpointV2 Name="ServiceEndpointV2" />
            <Endpoint Name="ServiceEndpointV2" />
          </GeneratedNames>
        </Extension>
      </Extensions>
    </StatefulServiceType>
    <CodePackage Name="Code" Version="1.0.0">
    <EntryPoint>
      <ExeHost>
        <Program>xxxxxxx.exe</Program>
      </ExeHost>
    </EntryPoint>
  </CodePackage>
  <ConfigPackage Name="Config" Version="1.0.0" />
  <Resources>
    <Endpoints>
      <Endpoint Name="xxxxxxxEndpointV2" />
      <Endpoint Name="xxxxxxxEndpoint" />
      <Endpoint Name="ServiceEndpointV2"   />
    </Endpoints>
  </Resources>
  <!-- The content will be generated during build -->
</ServiceManifest>

我做错了什么?为什么演员端点名称为空(值正确)?

4

1 回答 1

0

我检查了 CreateServiceInstanceListeners 方法

protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners()
        {
            return new[]
            {
                new ServiceInstanceListener(
                    context =>
                    new FabricTransportServiceRemotingListener(
                        context,
                        serviceRemotingMessageHandler: new MiddlewareServiceRemotingMessageDispatcher(
                            context,
                            this,
                            middlewareAction: MiddlewareAction,
                            serviceRemotingMessageBodyFactory: new JsonMessageFactory()),
                        serializationProvider: new ServiceRemotingJsonSerializationProvider()))
            };
    }

我注意到我错过了设置“名称”参数。当我设置它时,一切都很顺利。解决了。

于 2018-10-25T15:41:29.003 回答