[dubbo] branch master updated: Refactor, configuration override does not work properly. (#5709)
This is an automated email from the ASF dual-hosted git repository. liujun pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 12d99d6 Refactor, configuration override does not work properly. (#5709) 12d99d6 is described below commit 12d99d686f3b7946758a02554f81f562fc394419 Author: ken.lj AuthorDate: Thu Feb 20 15:00:26 2020 +0800 Refactor, configuration override does not work properly. (#5709) --- .../common/config/AbstractPrefixConfiguration.java | 52 .../common/config/CompositeConfiguration.java | 32 - .../apache/dubbo/common/config/Environment.java| 144 +++-- .../common/config/EnvironmentConfiguration.java| 10 +- .../dubbo/common/config/InmemoryConfiguration.java | 15 +-- .../common/config/PropertiesConfiguration.java | 10 +- .../dubbo/common/config/SystemConfiguration.java | 13 +- .../org/apache/dubbo/config/AbstractConfig.java| 13 +- .../config/context/ConfigConfigurationAdapter.java | 10 +- .../common/config/PropertiesConfigurationTest.java | 4 +- .../apache/dubbo/config/AbstractConfigTest.java| 4 + 11 files changed, 134 insertions(+), 173 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/config/AbstractPrefixConfiguration.java b/dubbo-common/src/main/java/org/apache/dubbo/common/config/AbstractPrefixConfiguration.java deleted file mode 100644 index a8cbe3d..000 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/config/AbstractPrefixConfiguration.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dubbo.common.config; - -import org.apache.dubbo.common.utils.StringUtils; - -/** - * This is an abstraction specially customized for the sequence Dubbo retrieves properties. - */ -public abstract class AbstractPrefixConfiguration implements Configuration { -protected String id; -protected String prefix; - -public AbstractPrefixConfiguration(String prefix, String id) { -if (StringUtils.isNotEmpty(prefix) && !prefix.endsWith(".")) { -this.prefix = prefix + "."; -} else { -this.prefix = prefix; -} -this.id = id; -} - -@Override -public Object getProperty(String key, Object defaultValue) { -Object value = null; -if (StringUtils.isNotEmpty(prefix)) { -if (StringUtils.isNotEmpty(id)) { -value = getInternalProperty(prefix + id + "." + key); -} -if (value == null) { -value = getInternalProperty(prefix + key); -} -} else { -value = getInternalProperty(key); -} -return value != null ? value : defaultValue; -} -} diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/config/CompositeConfiguration.java b/dubbo-common/src/main/java/org/apache/dubbo/common/config/CompositeConfiguration.java index b301ff0..eebf5a0 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/config/CompositeConfiguration.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/config/CompositeConfiguration.java @@ -18,27 +18,41 @@ package org.apache.dubbo.common.config; import org.apache.dubbo.common.logger.Logger; import org.apache.dubbo.common.logger.LoggerFactory; +import org.apache.dubbo.common.utils.StringUtils; import java.util.Arrays; import java.util.LinkedList; import java.util.List; /** - * + * This is an abstraction specially customized for the sequence Dubbo retrieves properties. */ public class CompositeConfiguration implements Configuration { private Logger logger = LoggerFactory.getLogger(CompositeConfiguration.class); +private String id; +private String prefix; + /** * List holding all the configuration */ private List configList = new LinkedList(); public CompositeConfiguration() { +this(null, null); +} +public CompositeConfiguration(String prefix, String id) { +if (StringUtils.isNotEmpty(prefix) && !prefix.endsWith(".")) { +
[dubbo] branch master updated: Polish #5442 (#5760)
This is an automated email from the ASF dual-hosted git repository. mercyblitz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new ff14005 Polish #5442 (#5760) ff14005 is described below commit ff14005475dc2e6e1e8c5081abb61e65faef464c Author: Mercy Ma AuthorDate: Thu Feb 20 11:46:14 2020 +0800 Polish #5442 (#5760) * Polish /apache/dubbo#5745 : Increasing the stack size in the start.sh * Polish /apache/dubbo#5297 : Only one of the multiple registration centers using nacos can register * Polish /apache/dubbo#5442 : VERSION_KEY和GROUP_KEY为空时,注册到NACOS的服务名与alibaba实现不一致,导致无法消费 * Polish /apache/dubbo#5442 : Merge upstream/master * Polish /apache/dubbo##5239 : Mock字段注入异常 * Polish /apache/dubbo##5239 : Mock字段注入异常 --- .../apache/dubbo/config/AbstractMethodConfig.java | 18 .../org/apache/dubbo/config/ServiceConfigBase.java | 11 ++--- .../apache/dubbo/registry/nacos/NacosRegistry.java | 52 ++ 3 files changed, 50 insertions(+), 31 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractMethodConfig.java b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractMethodConfig.java index 4f5e849..3a7b1a5 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractMethodConfig.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractMethodConfig.java @@ -62,7 +62,7 @@ public abstract class AbstractMethodConfig extends AbstractConfig { /** * The name of mock class which gets called when a service fails to execute - * + * * note that: the mock doesn't support on the provider side,and the mock is executed when a non-business exception * occurs after a remote service call */ @@ -157,18 +157,20 @@ public abstract class AbstractMethodConfig extends AbstractConfig { } public void setMock(String mock) { -if (mock == null) { -return; -} this.mock = mock; } -public void setMock(Boolean mock) { +/** + * Set the property "mock" + * + * @param mock the value of mock + * @since 2.7.6 + */ +public void setMock(Object mock) { if (mock == null) { -setMock((String) null); -} else { -setMock(mock.toString()); +return; } +this.setMock(String.valueOf(mock)); } public String getMerger() { diff --git a/dubbo-common/src/main/java/org/apache/dubbo/config/ServiceConfigBase.java b/dubbo-common/src/main/java/org/apache/dubbo/config/ServiceConfigBase.java index 9810207..4a7c282 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/config/ServiceConfigBase.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/config/ServiceConfigBase.java @@ -209,8 +209,8 @@ public abstract class ServiceConfigBase extends AbstractServiceConfig { } public void completeCompoundConfigs() { - super.completeCompoundConfigs(provider); - if(provider != null) { +super.completeCompoundConfigs(provider); +if (provider != null) { if (protocols == null) { setProtocols(provider.getProtocols()); } @@ -223,8 +223,9 @@ public abstract class ServiceConfigBase extends AbstractServiceConfig { if (StringUtils.isEmpty(protocolIds)) { setProtocolIds(provider.getProtocolIds()); } - } +} } + private void convertProtocolIdsToProtocols() { computeValidProtocolIds(); if (StringUtils.isEmpty(protocolIds)) { @@ -361,12 +362,12 @@ public abstract class ServiceConfigBase extends AbstractServiceConfig { } @Override -public void setMock(Boolean mock) { +public void setMock(String mock) { throw new IllegalArgumentException("mock doesn't support on provider side"); } @Override -public void setMock(String mock) { +public void setMock(Object mock) { throw new IllegalArgumentException("mock doesn't support on provider side"); } diff --git a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java index f26cf0c..2e61d22 100644 --- a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java +++ b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java @@ -27,6 +27,13 @@ import org.apache.dubbo.registry.NotifyListener; import org.apache.dubbo.registry.Registry; import org.apache.dubbo.registry.support.FailbackRegistry; +import com.alibaba.nacos.api.exception.NacosException; +import com.alibaba.nacos.api.naming.NamingService; +import
[dubbo-go] branch develop updated (2d4022d -> 2d70b6f)
This is an automated email from the ASF dual-hosted git repository. flycash pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/dubbo-go.git. from 2d4022d Merge pull request #359 from hxmhlt/mod_zk_listen new 0713fc1 add Rlock for dubbo Invoker new 6da0921 add code new c250592 update new 7f6fd6a add Notes new 0ee1cd4 fix bug new 167d221 fix bug new 873c7d9 fix proprem new 2d70b6f Merge pull request #358 from pantianying/addRlockForDubboInvoker The 1420 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: protocol/dubbo/dubbo_invoker.go | 35 ++- registry/directory/directory.go | 39 --- 2 files changed, 58 insertions(+), 16 deletions(-)
[dubbo-go] branch feature/rest updated (d93a2a3 -> bc64aed)
This is an automated email from the ASF dual-hosted git repository. flycash pushed a change to branch feature/rest in repository https://gitbox.apache.org/repos/asf/dubbo-go.git. from d93a2a3 Merge pull request #329 from Patrick0308/rest_protocol new 114fe40 change service key to path key new 01361a6 fix serviceKey new 8b884cc support req[] new fd0a076 fix when args is req[] new b67b76a fix path bug new b692796 modify server default consumes and produces new bc64aed Merge pull request #353 from Patrick0308/rest_protocol The 1376 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: protocol/rest/rest_config_initializer.go | 16 ++-- protocol/rest/rest_config_initializer_test.go | 4 +- protocol/rest/rest_interface/rest_config.go| 8 +- protocol/rest/rest_invoker_test.go | 59 - protocol/rest/rest_protocol.go | 10 +-- protocol/rest/rest_protocol_test.go| 24 +- protocol/rest/rest_server/go_restful_server.go | 112 +++-- 7 files changed, 188 insertions(+), 45 deletions(-)
[dubbo] branch master updated: nacos_registry_bugfix (#5212)
This is an automated email from the ASF dual-hosted git repository. mercyblitz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 0e30d76 nacos_registry_bugfix (#5212) 0e30d76 is described below commit 0e30d7649598c086103ecf38d4fe1d6c3eca7887 Author: 张志勇 AuthorDate: Wed Feb 19 16:02:24 2020 +0800 nacos_registry_bugfix (#5212) Co-authored-by: Xin Wang --- .../apache/dubbo/registry/nacos/NacosRegistry.java| 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java index 894ea52..f26cf0c 100644 --- a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java +++ b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java @@ -398,16 +398,17 @@ public class NacosRegistry extends FailbackRegistry { private void subscribeEventListener(String serviceName, final URL url, final NotifyListener listener) throws NacosException { -if (!nacosListeners.containsKey(serviceName)) { -EventListener eventListener = event -> { -if (event instanceof NamingEvent) { -NamingEvent e = (NamingEvent) event; -notifySubscriber(url, listener, e.getInstances()); -} -}; -namingService.subscribe(serviceName, eventListener); -nacosListeners.put(serviceName, eventListener); +if (nacosListeners.containsKey(serviceName)) { +logger.info("nacosListeners contains serviceName:" + serviceName); } +EventListener eventListener = event -> { +if (event instanceof NamingEvent) { +NamingEvent e = (NamingEvent) event; +notifySubscriber(url, listener, e.getInstances()); +} +}; +namingService.subscribe(serviceName, eventListener); +nacosListeners.put(serviceName, eventListener); } /**