[ISSUE-#7449] Script protocol also handle as config. (#7447)

This commit is contained in:
赵延 2021-03-26 14:00:52 +08:00 committed by GitHub
parent 376443af05
commit 057189e231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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";

View File

@ -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);