You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2021/03/26 06:01:12 UTC

[dubbo] branch 3.0 updated: [ISSUE-#7449] Script protocol also handle as config. (#7447)

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

liujun 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 057189e  [ISSUE-#7449] Script protocol also handle as config. (#7447)
057189e is described below

commit 057189e231d6dd32d4523dfa48ea800349a5b5cd
Author: 赵延 <10...@qq.com>
AuthorDate: Fri Mar 26 14:00:52 2021 +0800

    [ISSUE-#7449] Script protocol also handle as config. (#7447)
---
 .../main/java/org/apache/dubbo/common/constants/RegistryConstants.java | 2 ++
 .../org/apache/dubbo/registry/support/CacheableFailbackRegistry.java   | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/RegistryConstants.java b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/RegistryConstants.java
index bd8f43c..d0f41af 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/RegistryConstants.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/RegistryConstants.java
@@ -55,6 +55,8 @@ public interface RegistryConstants {
 
     String ROUTE_PROTOCOL = "route";
 
+    String ROUTE_SCRIPT_PROTOCOL = "script";
+
     String OVERRIDE_PROTOCOL = "override";
 
     String COMPATIBLE_CONFIG_KEY = "compatible_config";
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/CacheableFailbackRegistry.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/CacheableFailbackRegistry.java
index ec3f3ca..3289594 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/CacheableFailbackRegistry.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/CacheableFailbackRegistry.java
@@ -57,6 +57,7 @@ import static org.apache.dubbo.common.constants.RegistryConstants.CATEGORY_KEY;
 import static org.apache.dubbo.common.constants.RegistryConstants.EMPTY_PROTOCOL;
 import static org.apache.dubbo.common.constants.RegistryConstants.OVERRIDE_PROTOCOL;
 import static org.apache.dubbo.common.constants.RegistryConstants.ROUTE_PROTOCOL;
+import static org.apache.dubbo.common.constants.RegistryConstants.ROUTE_SCRIPT_PROTOCOL;
 import static org.apache.dubbo.common.url.component.DubboServiceAddressURL.PROVIDER_FIRST_KEYS;
 
 /**
@@ -165,7 +166,7 @@ public abstract class CacheableFailbackRegistry extends FailbackRegistry {
             urls = new ArrayList<>(1);
         } else {
             String rawProvider = providers.iterator().next();
-            if (rawProvider.startsWith(OVERRIDE_PROTOCOL) || rawProvider.startsWith(ROUTE_PROTOCOL)) {
+            if (rawProvider.startsWith(OVERRIDE_PROTOCOL) || rawProvider.startsWith(ROUTE_PROTOCOL) || rawProvider.startsWith(ROUTE_SCRIPT_PROTOCOL)) {
                 urls = toConfiguratorsWithoutEmpty(consumer, providers);
             } else {
                 urls = toUrlsWithoutEmpty(consumer, providers);