Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.7.8 Bugfix #6452

Merged
merged 91 commits into from Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
f608b21
Polish apache/dubbo#6296 : Adding the new methods into MetadataReport…
mercyblitz Jun 10, 2020
4e3c691
Polish apache/dubbo#6296 : Adding the new methods into MetadataReport…
mercyblitz Jun 10, 2020
e30a547
Polish apache/dubbo#6171 : [Feature] Introducing the composite implem…
mercyblitz Jun 10, 2020
351b439
Merge branch '2.7.8-dev' into 2.7.8-service-introspection
mercyblitz Jun 10, 2020
b086a95
2.7.8 service introspection (#6300)
mercyblitz Jun 10, 2020
b48d7d6
Polish apache/dubbo#6305 : [Refactor] ServiceConfig and ReferenceConf…
mercyblitz Jun 11, 2020
6172dd9
Merge remote-tracking branch 'origin/2.7.8-service-introspection' int…
mercyblitz Jun 11, 2020
60c441d
Merge remote-tracking branch 'upstream/master' into 2.7.8-service-int…
mercyblitz Jun 11, 2020
38e0d33
Polish apache/dubbo#6198 : [Issue] Fixing NacosDynamicConfiguration#p…
mercyblitz Jun 11, 2020
2a0d015
2.7.8 service introspection update (#6308)
mercyblitz Jun 11, 2020
a52ec0f
Polish apache/dubbo#6310 : Refactoring MetadataReport's methods
mercyblitz Jun 11, 2020
e2b9b56
Polish apache/dubbo#6198 : [Issue] Fixing NacosDynamicConfiguration#p…
mercyblitz Jun 11, 2020
ab03f26
Polish apache/dubbo#6198 : [Issue] Fixing NacosDynamicConfiguration#p…
mercyblitz Jun 11, 2020
55b95a7
Polish apache/dubbo#6315 : [Refactor] Refactoring the implementation …
mercyblitz Jun 12, 2020
454cea6
Polish apache/dubbo#6315 : Refactoring by TreePathDynamicConfiguration
mercyblitz Jun 12, 2020
2bdb538
Polish apache/dubbo#6315 : Refactoring ConsulDynamicConfiguration by …
mercyblitz Jun 12, 2020
2c92015
Polish apache/dubbo#6315 : Reset the config base path to be "metadata…
mercyblitz Jun 12, 2020
2fbc068
Polish apache/dubbo#6315 : Bugfix
mercyblitz Jun 12, 2020
ddc4cb7
Polish apache/dubbo#6315 : Bugfix
mercyblitz Jun 12, 2020
dd7b880
2.7.8 service introspection (#6317)
mercyblitz Jun 12, 2020
8a6a6bf
Merge remote-tracking branch 'upstream/2.7.8-dev' into 2.7.8-service-…
mercyblitz Jun 15, 2020
0154426
Merge remote-tracking branch 'upstream/2.7.8-dev' into 2.7.8-service-…
mercyblitz Jun 15, 2020
eba44fa
Polish apache/dubbo#6315 : Correct words
mercyblitz Jun 15, 2020
c546f3c
Polish apache/dubbo#6333 : [Refactor] Using mandatory implementation …
mercyblitz Jun 16, 2020
05e5c4f
Polish apache/dubbo#6336 : [Refactor] org.apache.dubbo.metadata.Servi…
mercyblitz Jun 17, 2020
e65f81f
2.7.8 service introspection (#6337)
mercyblitz Jun 17, 2020
719bad7
Merge remote-tracking branch 'upstream/2.7.8-dev' into 2.7.8-service-…
mercyblitz Jun 17, 2020
cac3c0d
Polish apache/dubbo#6170 : [Feature] Introducing the externalized con…
mercyblitz Jun 17, 2020
e72a3be
Polish apache/dubbo#6342 : [Enhancement] Introducing the composite Se…
mercyblitz Jun 18, 2020
64b474c
Refactor
mercyblitz Jun 18, 2020
36e21ca
Polish apache/dubbo#6172 : [Feature] Adding the "services" attribute …
mercyblitz Jun 19, 2020
7b03172
Polish apache/dubbo#6173 : [Feature] Adding the "services" attribute …
mercyblitz Jun 19, 2020
1b12937
Polish apache/dubbo#6346 : [Issue] Merging all subscribied URLs from …
mercyblitz Jun 19, 2020
77c82d4
Polish apache/dubbo#6346 : [Issue] Merging all subscribied URLs from …
mercyblitz Jun 19, 2020
e528d75
Polish apache/dubbo#6252
mercyblitz Jun 22, 2020
f4a02de
Polish apache/dubbo#6356 & apache/dubbo#6171
mercyblitz Jun 23, 2020
3be5aa2
Polish apache/dubbo#6356 & apache/dubbo#6171
mercyblitz Jun 23, 2020
0014485
Polish apache/dubbo#6224 : Filter chain was not invoked with local ca…
mercyblitz Jun 23, 2020
6f78b4d
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 23, 2020
74777d8
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 24, 2020
cd974c4
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 24, 2020
2d12ddd
2.7.8 service introspection (#6366)
mercyblitz Jun 24, 2020
c4ca993
Merge remote-tracking branch 'upstream/2.7.8-dev' into 2.7.8-service-…
mercyblitz Jun 24, 2020
cb2e421
Polish apache/dubbo#6322 : Adding META-INF/dubbo/internal/org.apache.…
mercyblitz Jun 24, 2020
32c55aa
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 24, 2020
69cd83d
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 28, 2020
74e378b
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 28, 2020
f24d7dd
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 28, 2020
275caec
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 28, 2020
ec6a169
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 29, 2020
a03aaf0
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 29, 2020
cddd02b
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 29, 2020
08f5029
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 29, 2020
9804107
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 29, 2020
9c1f4c0
Polish apache/dubbo#6322 : [Enhancement] Fix the issues of test-cases…
mercyblitz Jun 29, 2020
11b2f35
2.7.8 Test Cases (#6384)
mercyblitz Jun 29, 2020
f9796c9
Merge remote-tracking branch 'upstream/master' into 2.7.8-service-int…
mercyblitz Jun 30, 2020
d6409ac
Fixed the test-cases
mercyblitz Jun 30, 2020
88bd09f
2.7.8 Dev (#6386)
mercyblitz Jun 30, 2020
6ae8c0e
Fixes the issue of merging code in Github
mercyblitz Jun 30, 2020
7791051
Polish apache/dubbo#6389 : [Issue] Resolving the issues with ConsulSe…
mercyblitz Jul 1, 2020
c299a27
Merge branch '2.7.8-dev' into 2.7.8-release
mercyblitz Jul 1, 2020
29402cf
Merge remote-tracking branch 'upstream/master' into 2.7.8-release
mercyblitz Jul 1, 2020
5f5e78d
Merge remote-tracking branch 'origin/2.7.8-release' into 2.7.8-release
mercyblitz Jul 1, 2020
e69abc5
Fixes the test-cases
mercyblitz Jul 2, 2020
85ae544
Fixes the test-cases
mercyblitz Jul 2, 2020
14383bc
Fixes the test-cases
mercyblitz Jul 2, 2020
4f52351
Upgrade the release version to be 2.7.8
mercyblitz Jul 3, 2020
50361e1
Merge remote-tracking branch 'upstream/2.7.8-release' into 2.7.8-release
mercyblitz Jul 3, 2020
11e728c
Hessian2 whitelist (#6378)
chickenlj Jul 3, 2020
e4abd39
Polish apache/dubbo#6261 : Migration the latest Nacos registry implem…
mercyblitz Jul 3, 2020
30bfdb7
Merge remote-tracking branch 'upstream/master' into 2.7.8-release
mercyblitz Jul 3, 2020
9d5e8b3
Hessian whitelist2 (#6423)
chickenlj Jul 7, 2020
37640a3
Polish apache/dubbo#6425 : [Infrastructure] Upgrading the spring-cont…
mercyblitz Jul 7, 2020
71edd8b
Merge remote-tracking branch 'upstream/2.7.8-release' into 2.7.8-release
mercyblitz Jul 7, 2020
feb679b
double check lock (#6422)
diguage Jul 7, 2020
51c0ea8
Correction: comments about multipleConfig (#6414)
yuequan1997 Jul 7, 2020
8e4b281
Merge branch '2.7.8-release' into 2.7.8-release
mercyblitz Jul 8, 2020
204b599
Merge remote-tracking branch 'upstream/2.7.8-release' into 2.7.8-release
mercyblitz Jul 8, 2020
ec81db1
Merge remote-tracking branch 'origin/2.7.8-release' into 2.7.8-release
mercyblitz Jul 8, 2020
2a5f217
Polish apache/dubbo#6418 : Rest Protocol can't work when use Tomcat 9…
mercyblitz Jul 8, 2020
44345d5
fix bug: Rest Protocol can't work when use Tomcat as WebContainer (#6…
yiocio Jul 8, 2020
7285880
Merge remote-tracking branch 'upstream/master' into 2.7.8-release
mercyblitz Jul 8, 2020
f798140
Update @Service And @Reference with @DubboService and @DubboReference…
laddcn Jul 8, 2020
a243906
2.7.8 release (#6430)
mercyblitz Jul 8, 2020
40d03b0
add @SPI annotation (#6436)
chickenlj Jul 9, 2020
58d5e51
check invoker available status after proxy created. (#6435)
chickenlj Jul 9, 2020
5dc7018
Merge remote-tracking branch 'upstream/2.7.8-release' into 2.7.8-release
mercyblitz Jul 9, 2020
6cf8f03
Merge remote-tracking branch 'upstream/master' into 2.7.8-release
mercyblitz Jul 9, 2020
58428d6
Merge remote-tracking branch 'upstream/2.7.8-release' into 2.7.8-release
mercyblitz Jul 9, 2020
30d5b32
Polish apache/dubbo#6442 : The duplicated path in Tree-Path config-ce…
mercyblitz Jul 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -18,7 +18,6 @@

import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.config.configcenter.file.FileSystemDynamicConfiguration;
import org.apache.dubbo.common.utils.PathUtils;
import org.apache.dubbo.common.utils.StringUtils;

import java.util.Collection;
Expand All @@ -31,6 +30,7 @@
import static org.apache.dubbo.common.constants.CommonConstants.PATH_SEPARATOR;
import static org.apache.dubbo.common.utils.CollectionUtils.isEmpty;
import static org.apache.dubbo.common.utils.PathUtils.buildPath;
import static org.apache.dubbo.common.utils.PathUtils.normalize;

/**
* An abstract implementation of {@link DynamicConfiguration} is like "tree-structure" path :
Expand All @@ -46,6 +46,11 @@
*/
public abstract class TreePathDynamicConfiguration extends AbstractDynamicConfiguration {

/**
* The parameter name of URL for the config root path
*/
public static final String CONFIG_ROOT_PATH_PARAM_NAME = PARAM_NAME_PREFIX + "root-path";

/**
* The parameter name of URL for the config base path
*/
Expand Down Expand Up @@ -137,14 +142,24 @@ protected String buildPathKey(String group, String key) {
* @return non-null
*/
protected String getRootPath(URL url) {
String rootPath = PATH_SEPARATOR + getConfigNamespace(url) + getConfigBasePath(url);
rootPath = PathUtils.normalize(rootPath);
if (rootPath.endsWith(PATH_SEPARATOR)) {
rootPath = rootPath.substring(0, rootPath.length() - 1);

String rootPath = url.getParameter(CONFIG_ROOT_PATH_PARAM_NAME, buildRootPath(url));

rootPath = normalize(rootPath);

int rootPathLength = rootPath.length();

if (rootPathLength > 1 && rootPath.endsWith(PATH_SEPARATOR)) {
rootPath = rootPath.substring(0, rootPathLength - 1);
}

return rootPath;
}

private String buildRootPath(URL url) {
return PATH_SEPARATOR + getConfigNamespace(url) + getConfigBasePath(url);
}

/**
* Get the namespace from the specified {@link URL connection URl}
*
Expand Down
Expand Up @@ -36,6 +36,7 @@
import org.apache.dubbo.config.utils.ConfigValidationUtils;
import org.apache.dubbo.event.Event;
import org.apache.dubbo.event.EventDispatcher;
import org.apache.dubbo.metadata.WritableMetadataService;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.Protocol;
import org.apache.dubbo.rpc.ProxyFactory;
Expand Down Expand Up @@ -65,18 +66,22 @@
import static org.apache.dubbo.common.constants.CommonConstants.COMMA_SEPARATOR;
import static org.apache.dubbo.common.constants.CommonConstants.COMMA_SEPARATOR_CHAR;
import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER_SIDE;
import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_METADATA_STORAGE_TYPE;
import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.LOCALHOST_VALUE;
import static org.apache.dubbo.common.constants.CommonConstants.METADATA_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.METHODS_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.PROXY_CLASS_REF;
import static org.apache.dubbo.common.constants.CommonConstants.REMOTE_METADATA_STORAGE_TYPE;
import static org.apache.dubbo.common.constants.CommonConstants.REVISION_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.SEMICOLON_SPLIT_PATTERN;
import static org.apache.dubbo.common.constants.CommonConstants.SIDE_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.SUBSCRIBED_SERVICE_NAMES_KEY;
import static org.apache.dubbo.common.utils.NetUtils.isInvalidLocalHost;
import static org.apache.dubbo.common.utils.StringUtils.splitToSet;
import static org.apache.dubbo.config.Constants.DUBBO_IP_TO_REGISTRY;
import static org.apache.dubbo.registry.Constants.CONSUMER_PROTOCOL;
import static org.apache.dubbo.registry.Constants.REGISTER_IP_KEY;
import static org.apache.dubbo.rpc.Constants.LOCAL_PROTOCOL;
import static org.apache.dubbo.rpc.cluster.Constants.REFER_KEY;
Expand Down Expand Up @@ -263,6 +268,10 @@ public synchronized void init() {
// appendParameters(map, consumer, Constants.DEFAULT_KEY);
AbstractConfig.appendParameters(map, consumer);
AbstractConfig.appendParameters(map, this);
MetadataReportConfig metadataReportConfig = getMetadataReportConfig();
if (metadataReportConfig != null && metadataReportConfig.isValid()) {
map.putIfAbsent(METADATA_KEY, REMOTE_METADATA_STORAGE_TYPE);
}
Map<String, AsyncMethodInfo> attributes = null;
if (CollectionUtils.isNotEmpty(getMethods())) {
attributes = new HashMap<>();
Expand Down Expand Up @@ -382,6 +391,16 @@ private T createProxy(Map<String, String> map) {
if (logger.isInfoEnabled()) {
logger.info("Refer dubbo service " + interfaceClass.getName() + " from url " + invoker.getUrl());
}
/**
* @since 2.7.0
* ServiceData Store
*/
String metadata = map.get(METADATA_KEY);
WritableMetadataService metadataService = WritableMetadataService.getExtension(metadata == null ? DEFAULT_METADATA_STORAGE_TYPE : metadata);
if (metadataService != null) {
URL consumerURL = new URL(CONSUMER_PROTOCOL, map.remove(REGISTER_IP_KEY), 0, map.get(INTERFACE_KEY), map);
metadataService.publishServiceDefinition(consumerURL);
}
// create service proxy
return (T) PROXY_FACTORY.getProxy(invoker, ProtocolUtils.isGeneric(generic));
}
Expand Down
Expand Up @@ -37,6 +37,7 @@
import org.apache.dubbo.config.utils.ConfigValidationUtils;
import org.apache.dubbo.event.Event;
import org.apache.dubbo.event.EventDispatcher;
import org.apache.dubbo.metadata.WritableMetadataService;
import org.apache.dubbo.rpc.Exporter;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.Protocol;
Expand Down Expand Up @@ -67,13 +68,16 @@

import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.ANY_VALUE;
import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_METADATA_STORAGE_TYPE;
import static org.apache.dubbo.common.constants.CommonConstants.DUBBO;
import static org.apache.dubbo.common.constants.CommonConstants.DUBBO_IP_TO_BIND;
import static org.apache.dubbo.common.constants.CommonConstants.LOCALHOST_VALUE;
import static org.apache.dubbo.common.constants.CommonConstants.METADATA_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.METHODS_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER_SIDE;
import static org.apache.dubbo.common.constants.CommonConstants.REGISTER_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.REMOTE_METADATA_STORAGE_TYPE;
import static org.apache.dubbo.common.constants.CommonConstants.REVISION_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.SIDE_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.DYNAMIC_KEY;
Expand Down Expand Up @@ -340,6 +344,10 @@ private void doExportUrlsFor1Protocol(ProtocolConfig protocolConfig, List<URL> r
AbstractConfig.appendParameters(map, provider);
AbstractConfig.appendParameters(map, protocolConfig);
AbstractConfig.appendParameters(map, this);
MetadataReportConfig metadataReportConfig = getMetadataReportConfig();
if (metadataReportConfig != null && metadataReportConfig.isValid()) {
map.putIfAbsent(METADATA_KEY, REMOTE_METADATA_STORAGE_TYPE);
}
if (CollectionUtils.isNotEmpty(getMethods())) {
for (MethodConfig method : getMethods()) {
AbstractConfig.appendParameters(map, method, method.getName());
Expand Down Expand Up @@ -494,6 +502,14 @@ private void doExportUrlsFor1Protocol(ProtocolConfig protocolConfig, List<URL> r
Exporter<?> exporter = PROTOCOL.export(wrapperInvoker);
exporters.add(exporter);
}
/**
* @since 2.7.0
* ServiceData Store
*/
WritableMetadataService metadataService = WritableMetadataService.getExtension(url.getParameter(METADATA_KEY, DEFAULT_METADATA_STORAGE_TYPE));
if (metadataService != null) {
metadataService.publishServiceDefinition(url);
}
}
}
this.urls.add(url);
Expand Down

This file was deleted.

@@ -1,4 +1,2 @@
service-mapping=org.apache.dubbo.config.event.listener.ServiceNameMappingListener
config-logging=org.apache.dubbo.config.event.listener.LoggingEventListener
# since 2.7.8
publishing-service-definition=org.apache.dubbo.config.event.listener.PublishingServiceDefinitionListener
config-logging=org.apache.dubbo.config.event.listener.LoggingEventListener
Expand Up @@ -79,7 +79,7 @@ private String getFilePathKey(String pathTag, String... params) {
+ joinParams(PATH_SEPARATOR, params);
}

private String toServicePath() {
public String toServicePath() {
if (ANY_VALUE.equals(serviceInterface)) {
return "";
}
Expand Down
Expand Up @@ -25,8 +25,10 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import static org.apache.dubbo.common.config.configcenter.TreePathDynamicConfiguration.CONFIG_BASE_PATH_PARAM_NAME;
import static org.apache.dubbo.metadata.MetadataConstants.DEFAULT_PATH_TAG;
import static org.apache.dubbo.common.config.configcenter.TreePathDynamicConfiguration.CONFIG_ROOT_PATH_PARAM_NAME;
import static org.apache.dubbo.common.utils.StringUtils.SLASH;
import static org.apache.dubbo.common.utils.StringUtils.isBlank;
import static org.apache.dubbo.metadata.report.identifier.KeyTypeEnum.PATH;
import static org.apache.dubbo.rpc.cluster.Constants.EXPORT_KEY;
import static org.apache.dubbo.rpc.cluster.Constants.REFER_KEY;

Expand Down Expand Up @@ -60,21 +62,23 @@ public ConfigCenterBasedMetadataReportFactory(KeyTypeEnum keyType) {

@Override
public ConfigCenterBasedMetadataReport getMetadataReport(URL url) {

url = url.setPath(URL_PATH).removeParameters(EXPORT_KEY, REFER_KEY);

final URL actualURL;
if (url.getParameter(CONFIG_BASE_PATH_PARAM_NAME) == null) {
actualURL = url.addParameter(CONFIG_BASE_PATH_PARAM_NAME, DEFAULT_PATH_TAG);
} else {
actualURL = url;
}

url = url.setPath(URL_PATH);
final URL actualURL = resolveURLParameters(url);
String key = actualURL.toServiceString();
// Lock the metadata access process to ensure a single instance of the metadata instance
return metadataReportCache.computeIfAbsent(key, k -> new ConfigCenterBasedMetadataReport(actualURL, keyType));
}

private URL resolveURLParameters(URL url) {
URL resolvedURL = url.removeParameters(EXPORT_KEY, REFER_KEY);
if (PATH.equals(getKeyType())) { // Only handles for "PATH" type
if (isBlank(resolvedURL.getParameter(CONFIG_ROOT_PATH_PARAM_NAME))) {
resolvedURL = resolvedURL.addParameter(CONFIG_ROOT_PATH_PARAM_NAME, SLASH);
}
}
return resolvedURL;
}

/**
* Get {@link KeyTypeEnum the key type}
*
Expand Down