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

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


The following commit(s) were added to refs/heads/3.0 by this push:
     new 88313f0  Fix service parameter fetch order (#8385)
88313f0 is described below

commit 88313f04c87a77e3b1a414228cf8e5bdb9d5921e
Author: Albumen Kevin <[email protected]>
AuthorDate: Sun Aug 1 10:59:31 2021 +0800

    Fix service parameter fetch order (#8385)
---
 .../org/apache/dubbo/registry/client/InstanceAddressURL.java  | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/InstanceAddressURL.java
 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/InstanceAddressURL.java
index 02ace2a..46cc333 100644
--- 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/InstanceAddressURL.java
+++ 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/InstanceAddressURL.java
@@ -140,11 +140,14 @@ public class InstanceAddressURL extends URL {
 
     @Override
     public String getServiceParameter(String service, String key) {
-        String value = getInstanceParameter(key);
-        if (StringUtils.isEmpty(value) && metadataInfo != null) {
-            value = metadataInfo.getParameter(key, service);
+        if (metadataInfo != null) {
+            String value = metadataInfo.getParameter(key, service);
+            if (StringUtils.isNotEmpty(value)) {
+                return value;
+            }
         }
-        return value;
+
+        return getInstanceParameter(key);
     }
 
     /**

Reply via email to