This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.2 by this push:
     new 2c82cf7dfc Use serviceKey when to metadata ServiceSubscribeEvent 
(#12586)
2c82cf7dfc is described below

commit 2c82cf7dfccd435be7f8de7346a937a27f2d0a9a
Author: wxbty <[email protected]>
AuthorDate: Sat Jun 24 17:02:15 2023 +0800

    Use serviceKey when to metadata ServiceSubscribeEvent (#12586)
---
 .../apache/dubbo/metadata/report/identifier/MetadataIdentifier.java   | 4 ++++
 .../apache/dubbo/metadata/report/support/AbstractMetadataReport.java  | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/identifier/MetadataIdentifier.java
 
b/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/identifier/MetadataIdentifier.java
index b035a4fcea..9ce637f2ad 100644
--- 
a/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/identifier/MetadataIdentifier.java
+++ 
b/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/identifier/MetadataIdentifier.java
@@ -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;
+    }
+
 }
diff --git 
a/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/support/AbstractMetadataReport.java
 
b/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/support/AbstractMetadataReport.java
index dbfd78dc55..1c26581a95 100644
--- 
a/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/support/AbstractMetadataReport.java
+++ 
b/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/support/AbstractMetadataReport.java
@@ -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;

Reply via email to