无法通过参与者服务代理将终结点解析为参与者



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

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

然后我收到一个异常:

{"在地址中找不到NamedEndpoint'V2Listener''{\"端点\":{\":\"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>

我做错了什么?为什么参与者端点名称为空(值正确(?

我检查了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()))
};
}

我注意到我错过了设置"name"参数。当我设置它时,一切都很顺利。已解决。

最新更新