[dubbo] branch master updated: fix object attachments iteration bug (#6210)
This is an automated email from the ASF dual-hosted git repository. liujieqin 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 21e11e7 fix object attachments iteration bug (#6210) 21e11e7 is described below commit 21e11e7baedc3065919c701b5a79db68f3d9f3d1 Author: ken.lj AuthorDate: Wed May 27 13:58:39 2020 +0800 fix object attachments iteration bug (#6210) * fix object attachments iteration bug --- .../org/apache/dubbo/rpc/AttachmentsAdapter.java | 48 -- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AttachmentsAdapter.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AttachmentsAdapter.java index 873e7ae..1703792 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AttachmentsAdapter.java +++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AttachmentsAdapter.java @@ -29,25 +29,25 @@ public class AttachmentsAdapter { private Map attachments; public ObjectToStringMap(Map attachments) { +for (Entry entry : attachments.entrySet()) { +String converResult = convert(entry.getValue()); +if (converResult != null) { +super.put(entry.getKey(), converResult); +} +} this.attachments = attachments; } @Override -public String get(Object key) { -Object obj = attachments.get(key); -return convert(obj); -} - -@Override public String put(String key, String value) { -Object obj = attachments.put(key, value); -return convert(obj); +attachments.put(key, value); +return super.put(key, value); } @Override public String remove(Object key) { -Object obj = attachments.remove(key); -return convert(obj); +attachments.remove(key); +return super.remove(key); } private String convert(Object obj) { @@ -56,31 +56,17 @@ public class AttachmentsAdapter { } return null; // or JSON.toString(obj); } -} - -public static class StringToObjectMap extends HashMap { -private Map attachments; - -public StringToObjectMap(Map attachments) { -this.attachments = attachments; -} @Override -public Object get(Object key) { -return attachments.get(key); -} - -@Override -public Object put(String key, Object value) { -if (value instanceof String) { -return attachments.put(key, (String) value); -} -return null; // or JSON.toString(obj); +public void clear() { +attachments.clear(); +super.clear(); } @Override -public Object remove(Object key) { -return attachments.remove(key); +public void putAll(Map map) { +attachments.putAll(map); +super.putAll(map); } } -} +} \ No newline at end of file
[dubbo] branch master updated (bd6b580 -> 7325783)
This is an automated email from the ASF dual-hosted git repository. liujieqin pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git. from bd6b580 use interface name as path (#6212) add 7325783 Support spring bean as mock value (#6188) No new revisions were added by this update. Summary of changes: .../org/apache/dubbo/rpc/support/MockInvoker.java | 24 +++--- 1 file changed, 21 insertions(+), 3 deletions(-)
[dubbo-spring-boot-project] branch 2.7.x updated: Introducing the samples deployed the external Servlet container (#720)
This is an automated email from the ASF dual-hosted git repository. mercyblitz pushed a commit to branch 2.7.x in repository https://gitbox.apache.org/repos/asf/dubbo-spring-boot-project.git The following commit(s) were added to refs/heads/2.7.x by this push: new 611fafe Introducing the samples deployed the external Servlet container (#720) 611fafe is described below commit 611fafe44cdc5e426ffe3b45f6cae635eb693047 Author: Mercy Ma AuthorDate: Tue May 26 17:25:36 2020 +0800 Introducing the samples deployed the external Servlet container (#720) * Polish apache/dubbo-spring-boot-project#718 : [Samples] Introducing the samples deployed the external Servlet container * Polish apache/dubbo-spring-boot-project#718 : [Samples] Introducing the samples deployed the external Servlet container * Polish apache/dubbo-spring-boot-project#718 : [Samples] Introducing the samples deployed the external Servlet container --- README.md | 4 +- README_CN.md | 2 +- dubbo-spring-boot-actuator/README.md | 26 ++--- .../endpoint/DubboReferencesMetadataEndpoint.java | 3 +- .../endpoint/DubboServicesMetadataEndpoint.java| 3 +- .../endpoint/metadata/DubboReferencesMetadata.java | 3 +- .../endpoint/metadata/DubboServicesMetadata.java | 3 +- .../boot/autoconfigure/DubboAutoConfiguration.java | 9 +- .../DubboAutoConfigurationConsumerBootstrap.java | 4 +- .../DubboAutoConfigurationProviderBootstrap.java | 4 +- .../provider/service/DefaultDemoService.java | 4 +- .../src/main/resources/application.properties | 2 +- ...ExternalizedConfigurationConsumerBootstrap.java | 4 +- .../demo/provider/service/DefaultDemoService.java | 43 ...ExternalizedConfigurationProviderBootstrap.java | 5 +- .../provider/service/DefaultDemoService.java | 4 +- .../src/main/resources/application.properties | 2 +- dubbo-spring-boot-samples/pom.xml | 2 + .../DubboRegistryNacosConsumerBootstrap.java | 4 +- .../DubboRegistryNacosProviderBootstrap.java | 4 +- .../provider/service/DefaultDemoService.java | 4 +- .../src/main/resources/application.properties | 2 +- dubbo-spring-boot-samples/registry-samples/pom.xml | 16 +++ .../DubboRegistryZooKeeperConsumerBootstrap.java | 4 +- .../DubboRegistryZooKeeperProviderBootstrap.java | 4 +- .../provider/service/DefaultDemoService.java | 2 +- .../src/main/resources/application.properties | 2 +- dubbo-spring-boot-samples/sample-api/pom.xml | 1 + .../{demo => sample}/consumer/DemoService.java | 2 +- .../nacos-samples/consumer-sample/pom.xml | 16 +++ ...NacosServiceIntrospectionConsumerBootstrap.java | 2 +- .../nacos-samples/pom.xml | 16 +++ .../nacos-samples/provider-sample/pom.xml | 16 +++ .../provider/service/DefaultDemoService.java | 2 +- .../service-introspection-samples/pom.xml | 16 +++ .../zookeeper-samples/consumer-sample/pom.xml | 16 +++ ...eeperServiceIntrospectionConsumerBootstrap.java | 2 +- .../zookeeper-samples/pom.xml | 16 +++ .../zookeeper-samples/provider-sample/pom.xml | 16 +++ .../provider/service/DefaultDemoService.java | 2 +- .../consumer-sample/pom.xml| 115 + .../DubboServletContainerConsumerBootstrap.java} | 34 +++--- .../src/main/resources/application.yml | 8 ++ .../pom.xml| 23 - .../provider-sample/pom.xml| 115 + .../DubboServletContainerProviderBootstrap.java| 60 +++ .../provider/service/DefaultDemoService.java | 4 +- .../src/main/resources/application.properties | 16 +++ 48 files changed, 546 insertions(+), 121 deletions(-) diff --git a/README.md b/README.md index ec3f472..0cd3254 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ If you still use the legacy Dubbo whose version is less than 2.7.0, please use t ### Build from Source -If you'd like to attempt to experience latest features, you also can build from source as follow: +If you'd like to attempt to experience the latest features, you also can build from the source code as follow: 1. Maven install current project in your local repository. > Maven install = `mvn install` @@ -150,7 +150,7 @@ public interface DemoService { # Spring boot application spring.application.name=dubbo-auto-configuration-provider-demo # Base packages to scan Dubbo Component: @org.apache.dubbo.config.annotation.Service -dubbo.scan.base-packages=org.apache.dubbo.spring.boot.demo.provider.service + dubbo.scan.base-packages=org.apache.dubbo.spring.boot.sample.provider.service # Dubbo Application ## The