Use serviceKey when to metadata ServiceSubscribeEvent (#12586)

This commit is contained in:
wxbty 2023-06-24 17:02:15 +08:00 committed by GitHub
parent 27d9ce3836
commit 2c82cf7dfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -97,4 +97,8 @@ public class MetadataIdentifier extends BaseServiceMetadataIdentifier implements
this.application = application;
}
public String getUniqueServiceName() {
return serviceInterface != null ? URL.buildKey(serviceInterface, getGroup(), getVersion()) : null;
}
}

View File

@ -279,7 +279,7 @@ public abstract class AbstractMetadataReport implements MetadataReport {
private void storeProviderMetadataTask(MetadataIdentifier providerMetadataIdentifier, ServiceDefinition serviceDefinition) {
MetadataEvent metadataEvent = MetadataEvent.toServiceSubscribeEvent(applicationModel, serviceDefinition.getCanonicalName());
MetadataEvent metadataEvent = MetadataEvent.toServiceSubscribeEvent(applicationModel, providerMetadataIdentifier.getUniqueServiceName());
MetricsEventBus.post(metadataEvent, () ->
{
boolean result = true;