From 87806dfa790b7c2f8fb69d008f24e59a874fe4c9 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Fri, 14 Dec 2018 16:21:58 +0800 Subject: [PATCH 01/18] Bug fix on test case --- .../DubboAutoConfigurationOnMultipleConfigTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java index 75c950c12..938f29988 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java @@ -16,7 +16,14 @@ */ package com.alibaba.boot.dubbo.autoconfigure; -import com.alibaba.dubbo.config.*; +import com.alibaba.dubbo.config.ApplicationConfig; +import com.alibaba.dubbo.config.ConsumerConfig; +import com.alibaba.dubbo.config.ModuleConfig; +import com.alibaba.dubbo.config.MonitorConfig; +import com.alibaba.dubbo.config.ProtocolConfig; +import com.alibaba.dubbo.config.ProviderConfig; +import com.alibaba.dubbo.config.RegistryConfig; + import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -266,7 +273,7 @@ public void testMultipleDubboConfigConfiguration() { @Test public void testSingleDubboConfigConfiguration() { - Assert.assertNull(singleDubboConfigConfiguration); + Assert.assertNotNull(singleDubboConfigConfiguration); } From 276b7dbaf3910678e1277b08dc5fe3d69d150642 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Fri, 14 Dec 2018 16:22:56 +0800 Subject: [PATCH 02/18] Polish apache/incubator-dubbo-spring-boot-project#327 & apache/incubator-dubbo-spring-boot-project#325 --- README.md | 20 ++++++++++++++----- dubbo-spring-boot-actuator/pom.xml | 2 +- dubbo-spring-boot-autoconfigure/pom.xml | 8 +++++++- .../RelaxedDubboConfigBinder.java | 5 +++-- dubbo-spring-boot-parent/pom.xml | 16 ++++++++++++--- .../dubbo-spring-boot-sample-api/pom.xml | 2 +- .../dubbo-spring-boot-sample-consumer/pom.xml | 8 +++++++- .../dubbo-spring-boot-sample-provider/pom.xml | 8 +++++++- dubbo-spring-boot-samples/pom.xml | 2 +- dubbo-spring-boot-starter/pom.xml | 2 +- pom.xml | 2 +- 11 files changed, 57 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index c31f1b7d2..f95f0129b 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,21 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by adding the following dependency to your pom.xml ```xml - - com.alibaba.boot - dubbo-spring-boot-starter - 0.1.0 - + + + + com.alibaba.boot + dubbo-spring-boot-starter + 0.1.1 + + + + com.alibaba + dubbo + [2.6.5,) + + + ``` If your project failed to resolve the dependency, try to add the following repository: diff --git a/dubbo-spring-boot-actuator/pom.xml b/dubbo-spring-boot-actuator/pom.xml index 47224594d..a73c7cf94 100644 --- a/dubbo-spring-boot-actuator/pom.xml +++ b/dubbo-spring-boot-actuator/pom.xml @@ -5,7 +5,7 @@ dubbo-spring-boot-parent com.alibaba.boot - 0.1.1-SNAPSHOT + 0.1.1 ../dubbo-spring-boot-parent/pom.xml 4.0.0 diff --git a/dubbo-spring-boot-autoconfigure/pom.xml b/dubbo-spring-boot-autoconfigure/pom.xml index a272c29e4..9c556c8b6 100644 --- a/dubbo-spring-boot-autoconfigure/pom.xml +++ b/dubbo-spring-boot-autoconfigure/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-parent - 0.1.1-SNAPSHOT + 0.1.1 ../dubbo-spring-boot-parent 4.0.0 @@ -43,6 +43,12 @@ true + + + com.alibaba.spring + spring-context-support + + org.springframework.boot diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/RelaxedDubboConfigBinder.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/RelaxedDubboConfigBinder.java index e9c970700..b72b23465 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/RelaxedDubboConfigBinder.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/RelaxedDubboConfigBinder.java @@ -19,12 +19,13 @@ import com.alibaba.dubbo.config.AbstractConfig; import com.alibaba.dubbo.config.spring.context.properties.AbstractDubboConfigBinder; import com.alibaba.dubbo.config.spring.context.properties.DubboConfigBinder; + import org.springframework.beans.MutablePropertyValues; import org.springframework.boot.bind.RelaxedDataBinder; import java.util.Map; -import static com.alibaba.dubbo.config.spring.util.PropertySourcesUtils.getSubProperties; +import static com.alibaba.spring.util.PropertySourcesUtils.getSubProperties; /** * Spring Boot Relaxed {@link DubboConfigBinder} implementation @@ -41,7 +42,7 @@ public void bind(String prefix, C dubboConfig) { relaxedDataBinder.setIgnoreInvalidFields(isIgnoreInvalidFields()); relaxedDataBinder.setIgnoreUnknownFields(isIgnoreUnknownFields()); // Get properties under specified prefix from PropertySources - Map properties = getSubProperties(getPropertySources(), prefix); + Map properties = getSubProperties(getPropertySources(), prefix); // Convert Map to MutablePropertyValues MutablePropertyValues propertyValues = new MutablePropertyValues(properties); // Bind diff --git a/dubbo-spring-boot-parent/pom.xml b/dubbo-spring-boot-parent/pom.xml index 33198bf39..fa274b82d 100644 --- a/dubbo-spring-boot-parent/pom.xml +++ b/dubbo-spring-boot-parent/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-project - 0.1.1-SNAPSHOT + 0.1.1 ../pom.xml @@ -20,11 +20,14 @@ 1.7 UTF-8 UTF-8 - 1.5.13.RELEASE - 2.6.2 + 1.5.18.RELEASE + 2.6.5 0.2 3.4.9 2.12.0 + + 1.0.2 + 1.5 3.0.2 3.6.0 @@ -65,6 +68,13 @@ + + + com.alibaba.spring + spring-context-support + ${alibaba-spring-context-support.version} + + org.apache.zookeeper diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml index cbc973582..bfa59b71e 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-samples - 0.1.1-SNAPSHOT + 0.1.1 ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml index 3c3a578b3..d812fad3a 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-samples - 0.1.1-SNAPSHOT + 0.1.1 ../pom.xml 4.0.0 @@ -32,6 +32,12 @@ ${project.version} + + + com.alibaba + dubbo + + ${project.groupId} dubbo-spring-boot-sample-api diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml index a7273f1fd..87d7568d5 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-samples - 0.1.1-SNAPSHOT + 0.1.1 ../pom.xml 4.0.0 @@ -32,6 +32,12 @@ ${project.version} + + + com.alibaba + dubbo + + ${project.groupId} dubbo-spring-boot-sample-api diff --git a/dubbo-spring-boot-samples/pom.xml b/dubbo-spring-boot-samples/pom.xml index 715f92ac0..44a40da2b 100644 --- a/dubbo-spring-boot-samples/pom.xml +++ b/dubbo-spring-boot-samples/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-parent - 0.1.1-SNAPSHOT + 0.1.1 ../dubbo-spring-boot-parent/pom.xml 4.0.0 diff --git a/dubbo-spring-boot-starter/pom.xml b/dubbo-spring-boot-starter/pom.xml index 7de71f9eb..f8a6f9cde 100644 --- a/dubbo-spring-boot-starter/pom.xml +++ b/dubbo-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-parent - 0.1.1-SNAPSHOT + 0.1.1 ../dubbo-spring-boot-parent 4.0.0 diff --git a/pom.xml b/pom.xml index 47e37c475..7b4bb6ba4 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.alibaba.boot dubbo-spring-boot-project - 0.1.1-SNAPSHOT + 0.1.1 pom From 93be35d49a5dcf53cb0b4395597e00b0dd88d2ef Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Fri, 14 Dec 2018 16:48:50 +0800 Subject: [PATCH 03/18] Polish apache/incubator-dubbo-spring-boot-project#321 --- ...ultPropertiesEnvironmentPostProcessor.java | 122 ++++++++++++++++++ .../main/resources/META-INF/spring.factories | 5 +- ...ropertiesEnvironmentPostProcessorTest.java | 85 ++++++++++++ 3 files changed, 211 insertions(+), 1 deletion(-) create mode 100644 dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/env/DubboDefaultPropertiesEnvironmentPostProcessor.java create mode 100644 dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/env/DubboDefaultPropertiesEnvironmentPostProcessorTest.java diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/env/DubboDefaultPropertiesEnvironmentPostProcessor.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/env/DubboDefaultPropertiesEnvironmentPostProcessor.java new file mode 100644 index 000000000..d8a671b95 --- /dev/null +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/env/DubboDefaultPropertiesEnvironmentPostProcessor.java @@ -0,0 +1,122 @@ +/* + * 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 com.alibaba.boot.dubbo.env; + +import com.alibaba.dubbo.config.ApplicationConfig; +import com.alibaba.dubbo.config.spring.context.annotation.EnableDubboConfig; +import com.alibaba.dubbo.config.spring.context.annotation.EnableDubboConfigBinding; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.context.ContextIdApplicationContextInitializer; +import org.springframework.boot.env.EnvironmentPostProcessor; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.Ordered; +import org.springframework.core.env.ConfigurableEnvironment; +import org.springframework.core.env.Environment; +import org.springframework.core.env.MapPropertySource; +import org.springframework.core.env.MutablePropertySources; +import org.springframework.core.env.PropertySource; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +/** + * The lowest precedence {@link EnvironmentPostProcessor} processes + * {@link SpringApplication#setDefaultProperties(Properties) Spring Boot default properties} for Dubbo + * as late as possible before {@link ConfigurableApplicationContext#refresh() application context refresh}. + */ +public class DubboDefaultPropertiesEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered { + + /** + * The name of default {@link PropertySource} defined in SpringApplication#configurePropertySources method. + */ + private static final String PROPERTY_SOURCE_NAME = "defaultProperties"; + + /** + * The property name of Spring Application + * + * @see ContextIdApplicationContextInitializer + */ + private static final String SPRING_APPLICATION_NAME_PROPERTY = "spring.application.name"; + + /** + * The property name of {@link ApplicationConfig} + * + * @see EnableDubboConfig + * @see EnableDubboConfigBinding + */ + private static final String DUBBO_APPLICATION_NAME_PROPERTY = "dubbo.application.name"; + + @Override + public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { + MutablePropertySources propertySources = environment.getPropertySources(); + Map defaultProperties = createDefaultProperties(environment); + if (!CollectionUtils.isEmpty(defaultProperties)) { + addOrReplace(propertySources, defaultProperties); + } + } + + @Override + public int getOrder() { + return LOWEST_PRECEDENCE; + } + + private Map createDefaultProperties(ConfigurableEnvironment environment) { + Map defaultProperties = new HashMap(); + setDubboApplicationNameProperty(environment, defaultProperties); + return defaultProperties; + } + + private void setDubboApplicationNameProperty(Environment environment, Map defaultProperties) { + String springApplicationName = environment.getProperty(SPRING_APPLICATION_NAME_PROPERTY); + if (StringUtils.hasLength(springApplicationName) + && !environment.containsProperty(DUBBO_APPLICATION_NAME_PROPERTY)) { + defaultProperties.put(DUBBO_APPLICATION_NAME_PROPERTY, springApplicationName); + } + } + + /** + * Copy from BusEnvironmentPostProcessor#addOrReplace(MutablePropertySources, Map) + * + * @param propertySources {@link MutablePropertySources} + * @param map Default Dubbo Properties + */ + private void addOrReplace(MutablePropertySources propertySources, + Map map) { + MapPropertySource target = null; + if (propertySources.contains(PROPERTY_SOURCE_NAME)) { + PropertySource source = propertySources.get(PROPERTY_SOURCE_NAME); + if (source instanceof MapPropertySource) { + target = (MapPropertySource) source; + for (String key : map.keySet()) { + if (!target.containsProperty(key)) { + target.getSource().put(key, map.get(key)); + } + } + } + } + if (target == null) { + target = new MapPropertySource(PROPERTY_SOURCE_NAME, map); + } + if (!propertySources.contains(PROPERTY_SOURCE_NAME)) { + propertySources.addLast(target); + } + } +} \ No newline at end of file diff --git a/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories b/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories index 52fe93ce2..4ea2a1a98 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories +++ b/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories @@ -5,4 +5,7 @@ com.alibaba.boot.dubbo.autoconfigure.DubboAutoConfiguration org.springframework.context.ApplicationListener=\ com.alibaba.boot.dubbo.context.event.OverrideDubboConfigApplicationListener,\ com.alibaba.boot.dubbo.context.event.WelcomeLogoApplicationListener,\ -com.alibaba.boot.dubbo.context.event.AwaitingNonWebApplicationListener \ No newline at end of file +com.alibaba.boot.dubbo.context.event.AwaitingNonWebApplicationListener + +org.springframework.boot.env.EnvironmentPostProcessor=\ +com.alibaba.boot.dubbo.env.DubboDefaultPropertiesEnvironmentPostProcessor \ No newline at end of file diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/env/DubboDefaultPropertiesEnvironmentPostProcessorTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/env/DubboDefaultPropertiesEnvironmentPostProcessorTest.java new file mode 100644 index 000000000..626f2c9c6 --- /dev/null +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/env/DubboDefaultPropertiesEnvironmentPostProcessorTest.java @@ -0,0 +1,85 @@ +/* + * 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 com.alibaba.boot.dubbo.env; + +import org.junit.Assert; +import org.junit.Test; +import org.springframework.boot.SpringApplication; +import org.springframework.core.Ordered; +import org.springframework.core.env.MapPropertySource; +import org.springframework.core.env.MutablePropertySources; +import org.springframework.core.env.PropertySource; +import org.springframework.mock.env.MockEnvironment; + +import java.util.HashMap; + +/** + * {@link DubboDefaultPropertiesEnvironmentPostProcessor} Test + */ +public class DubboDefaultPropertiesEnvironmentPostProcessorTest { + + private DubboDefaultPropertiesEnvironmentPostProcessor instance = + new DubboDefaultPropertiesEnvironmentPostProcessor(); + + private SpringApplication springApplication = new SpringApplication(); + + @Test + public void testOrder() { + Assert.assertEquals(Ordered.LOWEST_PRECEDENCE, instance.getOrder()); + } + + @Test + public void testPostProcessEnvironment() { + MockEnvironment environment = new MockEnvironment(); + // Case 1 : Not Any property + instance.postProcessEnvironment(environment, springApplication); + // Get PropertySources + MutablePropertySources propertySources = environment.getPropertySources(); + // Nothing to change + PropertySource defaultPropertySource = propertySources.get("defaultProperties"); + Assert.assertNull(defaultPropertySource); + + // Case 2 : Only set property "spring.application.name" + environment.setProperty("spring.application.name", "demo-dubbo-application"); + instance.postProcessEnvironment(environment, springApplication); + defaultPropertySource = propertySources.get("defaultProperties"); + Object dubboApplicationName = defaultPropertySource.getProperty("dubbo.application.name"); + Assert.assertEquals("demo-dubbo-application", dubboApplicationName); + + // Case 3 : Only set property "dubbo.application.name" + // Rest environment + environment = new MockEnvironment(); + propertySources = environment.getPropertySources(); + environment.setProperty("dubbo.application.name", "demo-dubbo-application"); + instance.postProcessEnvironment(environment, springApplication); + defaultPropertySource = propertySources.get("defaultProperties"); + Assert.assertNull(defaultPropertySource); + dubboApplicationName = environment.getProperty("dubbo.application.name"); + Assert.assertEquals("demo-dubbo-application", dubboApplicationName); + + // Case 4 : If "defaultProperties" PropertySource is present in PropertySources + // Rest environment + environment = new MockEnvironment(); + propertySources = environment.getPropertySources(); + propertySources.addLast(new MapPropertySource("defaultProperties", new HashMap())); + environment.setProperty("spring.application.name", "demo-dubbo-application"); + instance.postProcessEnvironment(environment, springApplication); + defaultPropertySource = propertySources.get("defaultProperties"); + dubboApplicationName = defaultPropertySource.getProperty("dubbo.application.name"); + Assert.assertEquals("demo-dubbo-application", dubboApplicationName); + } +} From 7bad4d2996febae5abc909ed58db190f843b423e Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Fri, 14 Dec 2018 17:19:12 +0800 Subject: [PATCH 04/18] Polish apache/incubator-dubbo-spring-boot-project#220 no program --- .../consumer/bootstrap/DubboConsumerDemo.java | 10 +++++----- .../controller/DemoConsumerController.java | 3 ++- .../main/resources/application-prod.properties | 7 +++++++ .../src/main/resources/application.properties | 13 +------------ .../provider/bootstrap/DubboProviderDemo.java | 5 ++--- .../demo/provider/service/DefaultDemoService.java | 1 - .../main/resources/application-prod.properties | 9 +++++++++ .../src/main/resources/application.properties | 15 +-------------- 8 files changed, 27 insertions(+), 36 deletions(-) create mode 100644 dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application-prod.properties create mode 100644 dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application-prod.properties diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboConsumerDemo.java b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboConsumerDemo.java index 705101ae5..7f10d51ea 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboConsumerDemo.java +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboConsumerDemo.java @@ -17,8 +17,9 @@ package com.alibaba.boot.dubbo.demo.consumer.bootstrap; import com.alibaba.boot.dubbo.demo.consumer.controller.DemoConsumerController; -import org.springframework.boot.SpringApplication; + import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; /** * Dubbo Consumer Demo @@ -31,9 +32,8 @@ public class DubboConsumerDemo { public static void main(String[] args) { - - SpringApplication.run(DubboConsumerDemo.class,args); - + new SpringApplicationBuilder(DubboConsumerDemo.class) + .profiles("prod") + .run(args); } - } diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java index 5b105d601..f125b23bd 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java @@ -15,8 +15,10 @@ * limitations under the License. */ package com.alibaba.boot.dubbo.demo.consumer.controller; + import com.alibaba.boot.dubbo.demo.consumer.DemoService; import com.alibaba.dubbo.config.annotation.Reference; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -32,7 +34,6 @@ public class DemoConsumerController { @Reference(version = "${demo.service.version}", - application = "${dubbo.application.id}", url = "dubbo://localhost:12345") private DemoService demoService; diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application-prod.properties b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application-prod.properties new file mode 100644 index 000000000..523ba0de6 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application-prod.properties @@ -0,0 +1,7 @@ +# Application properties on prod profile +# Dubbo Endpoint (default status is disable) +endpoints.dubbo.enabled = true + +# Dubbo Health +## StatusChecker Name defaults (default : "memory", "load" ) +management.health.dubbo.status.defaults = memory \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.properties b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.properties index dbca83749..c6e2da38d 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.properties +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.properties @@ -8,21 +8,10 @@ management.security.enabled = false demo.service.version = 1.0.0 # Dubbo Config properties -## ApplicationConfig Bean -dubbo.application.id = dubbo-consumer-demo -dubbo.application.name = dubbo-consumer-demo - ## Legacy QOS Config dubbo.qos.port = 22223 ## ProtocolConfig Bean dubbo.protocol.id = dubbo dubbo.protocol.name = dubbo -dubbo.protocol.port = 12345 - -# Dubbo Endpoint (default status is disable) -endpoints.dubbo.enabled = true - -# Dubbo Health -## StatusChecker Name defaults (default : "memory", "load" ) -management.health.dubbo.status.defaults = memory \ No newline at end of file +dubbo.protocol.port = 12345 \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboProviderDemo.java b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboProviderDemo.java index db3fcf115..70a99d7cc 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboProviderDemo.java +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboProviderDemo.java @@ -17,6 +17,7 @@ package com.alibaba.boot.dubbo.demo.provider.bootstrap; import com.alibaba.boot.dubbo.demo.provider.service.DefaultDemoService; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; @@ -31,11 +32,9 @@ public class DubboProviderDemo { public static void main(String[] args) { - new SpringApplicationBuilder(DubboProviderDemo.class) + .profiles("prod") .web(false) .run(args); - } - } diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index 48bfc22bf..01ff1c6a5 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -28,7 +28,6 @@ */ @Service( version = "${demo.service.version}", - application = "${dubbo.application.id}", protocol = "${dubbo.protocol.id}", registry = "${dubbo.registry.id}" ) diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application-prod.properties b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application-prod.properties new file mode 100644 index 000000000..421a14005 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application-prod.properties @@ -0,0 +1,9 @@ +# Application properties on prod profile +# Dubbo Endpoint (default status is disable) +endpoints.dubbo.enabled = true + +# Dubbo Health +## StatusChecker Name defaults (default : "memory", "load" ) +management.health.dubbo.status.defaults = memory +## StatusChecker Name extras (default : empty ) +management.health.dubbo.status.extras = load,threadpool \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application.properties b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application.properties index 5828a7fe3..d0d1f2c91 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application.properties +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application.properties @@ -1,7 +1,6 @@ # Spring boot application spring.application.name = dubbo-provider-demo server.port = 9090 -management.port = 9091 management.security.enabled = false # Service Version @@ -10,11 +9,8 @@ demo.service.version = 1.0.0 # Base packages to scan Dubbo Components (e.g @Service , @Reference) dubbo.scan.basePackages = com.alibaba.boot.dubbo.demo.provider.service - # Dubbo Config properties ## ApplicationConfig Bean -dubbo.application.id = dubbo-provider-demo -dubbo.application.name = dubbo-provider-demo dubbo.application.qos.port=22222 dubbo.application.qos.enable=true @@ -26,13 +22,4 @@ dubbo.protocol.status = server ## RegistryConfig Bean dubbo.registry.id = my-registry -dubbo.registry.address = N/A - -# Dubbo Endpoint (default status is disable) -endpoints.dubbo.enabled = true - -# Dubbo Health -## StatusChecker Name defaults (default : "memory", "load" ) -management.health.dubbo.status.defaults = memory -## StatusChecker Name extras (default : empty ) -management.health.dubbo.status.extras = load,threadpool \ No newline at end of file +dubbo.registry.address = N/A \ No newline at end of file From c092b3f717d2e135f415ec1d769b3b3f26da9004 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Fri, 14 Dec 2018 18:00:30 +0800 Subject: [PATCH 05/18] Switch Yaml file --- .../dubbo-spring-boot-sample-consumer/pom.xml | 2 +- .../resources/application-prod.properties | 7 ----- .../src/main/resources/application.properties | 17 ---------- .../src/main/resources/application.yml | 31 +++++++++++++++++++ 4 files changed, 32 insertions(+), 25 deletions(-) delete mode 100644 dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application-prod.properties delete mode 100644 dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.properties create mode 100644 dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.yml diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml index d812fad3a..c130b5f94 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-samples - 0.1.1 + 0.1.2 ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application-prod.properties b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application-prod.properties deleted file mode 100644 index 523ba0de6..000000000 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application-prod.properties +++ /dev/null @@ -1,7 +0,0 @@ -# Application properties on prod profile -# Dubbo Endpoint (default status is disable) -endpoints.dubbo.enabled = true - -# Dubbo Health -## StatusChecker Name defaults (default : "memory", "load" ) -management.health.dubbo.status.defaults = memory \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.properties b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.properties deleted file mode 100644 index c6e2da38d..000000000 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.properties +++ /dev/null @@ -1,17 +0,0 @@ -# Spring boot application -spring.application.name = dubbo-consumer-demo -server.port = 8080 -management.port = 8081 -management.security.enabled = false - -# Service Version -demo.service.version = 1.0.0 - -# Dubbo Config properties -## Legacy QOS Config -dubbo.qos.port = 22223 - -## ProtocolConfig Bean -dubbo.protocol.id = dubbo -dubbo.protocol.name = dubbo -dubbo.protocol.port = 12345 \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.yml b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.yml new file mode 100644 index 000000000..b61aec0e4 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.yml @@ -0,0 +1,31 @@ +spring: + application: + name: dubbo-consumer-demo + +server: + port: 8080 + +management: + port: 8081 + security: + enabled: false + +dubbo: + protocol: + id: dubbo + name: dubbo + port: 12345 + +--- +spring: + profiles: prod + +endpoints: + dubbo: + enabled: false + +management: + health: + dubbo: + status: + defaults: memory \ No newline at end of file From ff9df81bfd54e09739fcab6170172c1048e625df Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Fri, 14 Dec 2018 18:00:51 +0800 Subject: [PATCH 06/18] Update version to be 0.2.0 --- dubbo-spring-boot-actuator/pom.xml | 2 +- dubbo-spring-boot-autoconfigure/pom.xml | 2 +- dubbo-spring-boot-parent/pom.xml | 2 +- dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml | 2 +- .../dubbo-spring-boot-sample-provider/pom.xml | 2 +- dubbo-spring-boot-samples/pom.xml | 2 +- dubbo-spring-boot-starter/pom.xml | 2 +- pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dubbo-spring-boot-actuator/pom.xml b/dubbo-spring-boot-actuator/pom.xml index a73c7cf94..760aaeaa9 100644 --- a/dubbo-spring-boot-actuator/pom.xml +++ b/dubbo-spring-boot-actuator/pom.xml @@ -5,7 +5,7 @@ dubbo-spring-boot-parent com.alibaba.boot - 0.1.1 + 0.1.2 ../dubbo-spring-boot-parent/pom.xml 4.0.0 diff --git a/dubbo-spring-boot-autoconfigure/pom.xml b/dubbo-spring-boot-autoconfigure/pom.xml index 9c556c8b6..d79f4d86a 100644 --- a/dubbo-spring-boot-autoconfigure/pom.xml +++ b/dubbo-spring-boot-autoconfigure/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-parent - 0.1.1 + 0.1.2 ../dubbo-spring-boot-parent 4.0.0 diff --git a/dubbo-spring-boot-parent/pom.xml b/dubbo-spring-boot-parent/pom.xml index fa274b82d..7fd4a4d7e 100644 --- a/dubbo-spring-boot-parent/pom.xml +++ b/dubbo-spring-boot-parent/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-project - 0.1.1 + 0.1.2 ../pom.xml diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml index bfa59b71e..5df80600c 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-samples - 0.1.1 + 0.1.2 ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml index 87d7568d5..41fa73ae7 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-samples - 0.1.1 + 0.1.2 ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/pom.xml b/dubbo-spring-boot-samples/pom.xml index 44a40da2b..a1ce4d5c7 100644 --- a/dubbo-spring-boot-samples/pom.xml +++ b/dubbo-spring-boot-samples/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-parent - 0.1.1 + 0.1.2 ../dubbo-spring-boot-parent/pom.xml 4.0.0 diff --git a/dubbo-spring-boot-starter/pom.xml b/dubbo-spring-boot-starter/pom.xml index f8a6f9cde..425c96a55 100644 --- a/dubbo-spring-boot-starter/pom.xml +++ b/dubbo-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ com.alibaba.boot dubbo-spring-boot-parent - 0.1.1 + 0.1.2 ../dubbo-spring-boot-parent 4.0.0 diff --git a/pom.xml b/pom.xml index 7b4bb6ba4..dea9ad3df 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.alibaba.boot dubbo-spring-boot-project - 0.1.1 + 0.1.2 pom From c104c2a18c5d774ee2f79b3ef21a2c55dc75f839 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 18 Dec 2018 17:29:21 +0800 Subject: [PATCH 07/18] Polish apache/incubator-dubbo-spring-boot-project#218 --- .../spring-configuration-metadata.json | 1098 +++++++++++++++++ 1 file changed, 1098 insertions(+) create mode 100644 dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json diff --git a/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json b/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json new file mode 100644 index 000000000..7ce2ceec9 --- /dev/null +++ b/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json @@ -0,0 +1,1098 @@ +{ + "hints": [], + "groups": [], + "properties": [ + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.architecture", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.compiler", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.default", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.dump-directory", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.environment", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.id", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.logger", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.monitor", + "type": "com.alibaba.dubbo.config.MonitorConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.name", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.organization", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.owner", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.parameters", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.qos-accept-foreign-ip", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.qos-enable", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.qos-port", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.registries", + "type": "java.util.List" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.registry", + "type": "com.alibaba.dubbo.config.RegistryConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ApplicationConfig", + "name": "dubbo.application.version", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.boot.dubbo.autoconfigure.MultipleDubboConfigBindingProperties", + "name": "dubbo.applications", + "description": "Multiple {@link ApplicationConfig} property", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.boot.dubbo.autoconfigure.DubboConfigProperties", + "name": "dubbo.config.multiple", + "description": "Indicates multiple properties binding from externalized configuration or not.", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.boot.dubbo.autoconfigure.DubboConfigProperties", + "name": "dubbo.config.override", + "description": "Indicates override {@link ConfigUtils#getProperties() Dubbo config properties} from externalized configuration\n or not.", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.actives", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.application", + "type": "com.alibaba.dubbo.config.ApplicationConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.async", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.cache", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.callbacks", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.check", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.client", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.cluster", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.connections", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.default", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.filter", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.generic", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.group", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.id", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.init", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "deprecated": true, + "name": "dubbo.consumer.injvm", + "type": "java.lang.Boolean", + "deprecation": {} + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.layer", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.lazy", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.listener", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.loadbalance", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "deprecated": true, + "name": "dubbo.consumer.local", + "type": "java.lang.String", + "deprecation": {} + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.merger", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.mock", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.module", + "type": "com.alibaba.dubbo.config.ModuleConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.monitor", + "type": "com.alibaba.dubbo.config.MonitorConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.onconnect", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.ondisconnect", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.owner", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.parameters", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.proxy", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.reconnect", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.registries", + "type": "java.util.List" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.registry", + "type": "com.alibaba.dubbo.config.RegistryConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.retries", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.scope", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.sent", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.sticky", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.stub", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.timeout", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.validation", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ConsumerConfig", + "name": "dubbo.consumer.version", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.boot.dubbo.autoconfigure.MultipleDubboConfigBindingProperties", + "name": "dubbo.consumers", + "description": "Multiple {@link ConsumerConfig} property", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.dubbo.config.ModuleConfig", + "name": "dubbo.module.default", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ModuleConfig", + "name": "dubbo.module.id", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ModuleConfig", + "name": "dubbo.module.monitor", + "type": "com.alibaba.dubbo.config.MonitorConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ModuleConfig", + "name": "dubbo.module.name", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ModuleConfig", + "name": "dubbo.module.organization", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ModuleConfig", + "name": "dubbo.module.owner", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ModuleConfig", + "name": "dubbo.module.registries", + "type": "java.util.List" + }, + { + "sourceType": "com.alibaba.dubbo.config.ModuleConfig", + "name": "dubbo.module.registry", + "type": "com.alibaba.dubbo.config.RegistryConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ModuleConfig", + "name": "dubbo.module.version", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.boot.dubbo.autoconfigure.MultipleDubboConfigBindingProperties", + "name": "dubbo.modules", + "description": "Multiple {@link ModuleConfig} property", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.dubbo.config.MonitorConfig", + "name": "dubbo.monitor.address", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.MonitorConfig", + "name": "dubbo.monitor.default", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.MonitorConfig", + "name": "dubbo.monitor.group", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.MonitorConfig", + "name": "dubbo.monitor.id", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.MonitorConfig", + "name": "dubbo.monitor.parameters", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.dubbo.config.MonitorConfig", + "name": "dubbo.monitor.password", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.MonitorConfig", + "name": "dubbo.monitor.protocol", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.MonitorConfig", + "name": "dubbo.monitor.username", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.MonitorConfig", + "name": "dubbo.monitor.version", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.boot.dubbo.autoconfigure.MultipleDubboConfigBindingProperties", + "name": "dubbo.monitors", + "description": "Multiple {@link MonitorConfig} property", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.accepts", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.accesslog", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.buffer", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.charset", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.client", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.codec", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.contextpath", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.default", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.dispatcher", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "deprecated": true, + "name": "dubbo.protocol.dispather", + "type": "java.lang.String", + "deprecation": {} + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.exchanger", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.heartbeat", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.host", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.id", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.iothreads", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.name", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.networker", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.parameters", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "deprecated": true, + "name": "dubbo.protocol.path", + "type": "java.lang.String", + "deprecation": {} + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.payload", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.port", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.prompt", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.queues", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.register", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.serialization", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.server", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.status", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.telnet", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.threadpool", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.threads", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProtocolConfig", + "name": "dubbo.protocol.transporter", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.boot.dubbo.autoconfigure.MultipleDubboConfigBindingProperties", + "name": "dubbo.protocols", + "description": "Multiple {@link ProtocolConfig} property", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.accepts", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.accesslog", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.actives", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.application", + "type": "com.alibaba.dubbo.config.ApplicationConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.async", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.buffer", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.cache", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.callbacks", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.charset", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.client", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.cluster", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.codec", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.connections", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.contextpath", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "deprecated": true, + "name": "dubbo.provider.default", + "type": "java.lang.Boolean", + "deprecation": {} + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.delay", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.deprecated", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.dispatcher", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "deprecated": true, + "name": "dubbo.provider.dispather", + "type": "java.lang.String", + "deprecation": {} + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.document", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.dynamic", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.exchanger", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.executes", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.export", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.filter", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.group", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.host", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.id", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.iothreads", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.layer", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.listener", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.loadbalance", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "deprecated": true, + "name": "dubbo.provider.local", + "type": "java.lang.String", + "deprecation": {} + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.merger", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.mock", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.module", + "type": "com.alibaba.dubbo.config.ModuleConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.monitor", + "type": "com.alibaba.dubbo.config.MonitorConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.networker", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.onconnect", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.ondisconnect", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.owner", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.parameters", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "deprecated": true, + "name": "dubbo.provider.path", + "type": "java.lang.String", + "deprecation": {} + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.payload", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "deprecated": true, + "name": "dubbo.provider.port", + "type": "java.lang.Integer", + "deprecation": {} + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.prompt", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.protocol", + "type": "com.alibaba.dubbo.config.ProtocolConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.protocols", + "type": "java.util.List" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.proxy", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.queues", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.register", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.registries", + "type": "java.util.List" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.registry", + "type": "com.alibaba.dubbo.config.RegistryConfig" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.retries", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.scope", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.sent", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.serialization", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.server", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.status", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.stub", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.telnet", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.threadpool", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.threads", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.timeout", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.token", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.transporter", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.validation", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.version", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.wait", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.warmup", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.ProviderConfig", + "name": "dubbo.provider.weight", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.boot.dubbo.autoconfigure.MultipleDubboConfigBindingProperties", + "name": "dubbo.providers", + "description": "Multiple {@link ProviderConfig} property", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.boot.dubbo.autoconfigure.MultipleDubboConfigBindingProperties", + "name": "dubbo.registries", + "description": "Multiple {@link RegistryConfig} property", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.address", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.check", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.client", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.cluster", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.default", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.dynamic", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.file", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.group", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.id", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.parameters", + "type": "java.util.Map" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.password", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.port", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.protocol", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.register", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.server", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.session", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.subscribe", + "type": "java.lang.Boolean" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.timeout", + "type": "java.lang.Integer" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "deprecated": true, + "name": "dubbo.registry.transport", + "type": "java.lang.String", + "deprecation": {} + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.transporter", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.username", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "name": "dubbo.registry.version", + "type": "java.lang.String" + }, + { + "sourceType": "com.alibaba.dubbo.config.RegistryConfig", + "deprecated": true, + "name": "dubbo.registry.wait", + "type": "java.lang.Integer", + "deprecation": {} + }, + { + "sourceType": "com.alibaba.boot.dubbo.autoconfigure.DubboScanProperties", + "name": "dubbo.scan.base-packages", + "description": "The base-packages to scan , the multiple-value is delimited by comma\n\n @see EnableDubbo#scanBasePackages()", + "type": "java.util.Set" + } + ] +} \ No newline at end of file From 0e8d108c994358f8cab2ff28befbf163e6763a37 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 18 Dec 2018 17:39:28 +0800 Subject: [PATCH 08/18] Update Documents --- README.md | 4 ++-- README_CN.md | 2 +- dubbo-spring-boot-actuator/README.md | 2 +- dubbo-spring-boot-actuator/README_CN.md | 4 ++-- dubbo-spring-boot-autoconfigure/README.md | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f95f0129b..7a0b7c3b0 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by addi com.alibaba.boot dubbo-spring-boot-starter - 0.1.1 + 0.1.2 @@ -65,7 +65,7 @@ If you'd like to attempt to experience latest features, you also can build from | versions | Java | Spring Boot | Dubbo | | -------- | ----- | ----------- | ---------- | -| `0.1.1` | 1.7+ | `1.5.x` | `2.6.2` + | +| `0.1.x` | 1.7+ | `1.5.x` | `2.6.x` + | ## Getting Started diff --git a/README_CN.md b/README_CN.md index 83d5775ca..e80135c97 100644 --- a/README_CN.md +++ b/README_CN.md @@ -56,7 +56,7 @@ | 版本 | Java | Spring Boot | Dubbo | | -------- | ----- | ----------------- | ---------- | -| `0.1.1` | 1.7+ | `1.5.x` | `2.6.2`+ | +| `0.1.2` | 1.7+ | `1.5.x` | `2.6.x`+ | diff --git a/dubbo-spring-boot-actuator/README.md b/dubbo-spring-boot-actuator/README.md index 257d9f7a9..e92dcc4ed 100644 --- a/dubbo-spring-boot-actuator/README.md +++ b/dubbo-spring-boot-actuator/README.md @@ -21,7 +21,7 @@ You can introduce the latest `dubbo-spring-boot-actuator` to your project by ad com.alibaba.boot dubbo-spring-boot-actuator - 0.1.1-SNAPSHOT + 0.1.2 ``` If your project failed to resolve the dependency, try to add the following repository: diff --git a/dubbo-spring-boot-actuator/README_CN.md b/dubbo-spring-boot-actuator/README_CN.md index 8273780a0..a40de6dd1 100644 --- a/dubbo-spring-boot-actuator/README_CN.md +++ b/dubbo-spring-boot-actuator/README_CN.md @@ -31,14 +31,14 @@ com.alibaba.boot dubbo-spring-boot-starter - 0.1.1-SNAPSHOT + 0.1.2 com.alibaba.boot dubbo-spring-boot-actuator - 0.1.1-SNAPSHOT + 0.1.2 ... diff --git a/dubbo-spring-boot-autoconfigure/README.md b/dubbo-spring-boot-autoconfigure/README.md index 15aacb920..a3e257c32 100644 --- a/dubbo-spring-boot-autoconfigure/README.md +++ b/dubbo-spring-boot-autoconfigure/README.md @@ -23,7 +23,7 @@ You can introduce the latest `dubbo-spring-boot-autoconfigure` to your project com.alibaba.boot dubbo-spring-boot-autoconfigure - 0.1.1-SNAPSHOT + 0.1.2 ``` From 6f871e6d821d63c7a3b2c47eaee06081651ec719 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 18 Dec 2018 17:49:32 +0800 Subject: [PATCH 09/18] Fix the test case's bugs --- .../endpoint/mvc/DubboMvcEndpoint.java | 44 ++++++++++++++++--- .../endpoint/mvc/DubboMvcEndpointTest.java | 3 +- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpoint.java index 125cd3420..7b324ca5d 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpoint.java @@ -17,11 +17,22 @@ package com.alibaba.boot.dubbo.actuate.endpoint.mvc; import com.alibaba.boot.dubbo.actuate.endpoint.DubboEndpoint; -import com.alibaba.dubbo.config.*; +import com.alibaba.dubbo.config.AbstractConfig; +import com.alibaba.dubbo.config.ApplicationConfig; +import com.alibaba.dubbo.config.ConsumerConfig; +import com.alibaba.dubbo.config.MethodConfig; +import com.alibaba.dubbo.config.ModuleConfig; +import com.alibaba.dubbo.config.MonitorConfig; +import com.alibaba.dubbo.config.ProtocolConfig; +import com.alibaba.dubbo.config.ProviderConfig; +import com.alibaba.dubbo.config.ReferenceConfig; +import com.alibaba.dubbo.config.RegistryConfig; +import com.alibaba.dubbo.config.ServiceConfig; import com.alibaba.dubbo.config.annotation.Reference; import com.alibaba.dubbo.config.spring.ReferenceBean; import com.alibaba.dubbo.config.spring.ServiceBean; import com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; @@ -49,10 +60,20 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.net.URL; -import java.util.*; +import java.util.Collection; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; import java.util.concurrent.ConcurrentMap; -import static com.alibaba.boot.dubbo.actuate.endpoint.DubboEndpoint.*; +import static com.alibaba.boot.dubbo.actuate.endpoint.DubboEndpoint.DUBBO_CONFIGS_ENDPOINT_URI; +import static com.alibaba.boot.dubbo.actuate.endpoint.DubboEndpoint.DUBBO_PROPERTIES_ENDPOINT_URI; +import static com.alibaba.boot.dubbo.actuate.endpoint.DubboEndpoint.DUBBO_REFERENCES_ENDPOINT_URI; +import static com.alibaba.boot.dubbo.actuate.endpoint.DubboEndpoint.DUBBO_SERVICES_ENDPOINT_URI; +import static com.alibaba.boot.dubbo.actuate.endpoint.DubboEndpoint.DUBBO_SHUTDOWN_ENDPOINT_URI; import static com.alibaba.boot.dubbo.util.DubboUtils.filterDubboProperties; import static com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.BEAN_NAME; import static com.alibaba.dubbo.registry.support.AbstractRegistryFactory.getRegistries; @@ -182,8 +203,18 @@ public Map> references() { Map> referencesMetadata = new LinkedHashMap<>(); - Map> injectedElementReferenceBeanMap - = resolveInjectedElementReferenceBeanMap(); + ReferenceAnnotationBeanPostProcessor beanPostProcessor = getReferenceAnnotationBeanPostProcessor(); + + referencesMetadata.putAll(buildReferencesMetadata(beanPostProcessor.getInjectedFieldReferenceBeanMap())); + referencesMetadata.putAll(buildReferencesMetadata(beanPostProcessor.getInjectedMethodReferenceBeanMap())); + + return referencesMetadata; + } + + + private Map> buildReferencesMetadata( + Map> injectedElementReferenceBeanMap) { + Map> referencesMetadata = new LinkedHashMap<>(); for (Map.Entry> entry : injectedElementReferenceBeanMap.entrySet()) { @@ -200,7 +231,6 @@ public Map> references() { } return referencesMetadata; - } @RequestMapping(value = DUBBO_PROPERTIES_ENDPOINT_URI, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @@ -271,7 +301,7 @@ private Map> resolveInjected getFieldValue(processor, "injectionMetadataCache", ConcurrentMap.class); ConcurrentMap> referenceBeansCache = - getFieldValue(processor, "referenceBeansCache", ConcurrentMap.class); + getFieldValue(processor, "referenceBeanCache", ConcurrentMap.class); for (InjectionMetadata metadata : injectionMetadataCache.values()) { diff --git a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java index 26962cb2b..e7fadaccc 100644 --- a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java +++ b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java @@ -19,6 +19,7 @@ import com.alibaba.boot.dubbo.actuate.endpoint.DubboEndpoint; import com.alibaba.boot.dubbo.autoconfigure.DubboAutoConfiguration; import com.alibaba.dubbo.config.annotation.Service; + import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -134,7 +135,7 @@ public void testServices() { Assert.assertEquals(1, services.size()); - Map demoServiceMeta = services.get("ServiceBean:dubboMvcEndpointTest.DefaultDemoService:com.alibaba.boot.dubbo.actuate.endpoint.mvc.DubboMvcEndpointTest$DemoService:1.0.0"); + Map demoServiceMeta = services.get("ServiceBean:com.alibaba.boot.dubbo.actuate.endpoint.mvc.DubboMvcEndpointTest$DemoService:1.0.0"); Assert.assertEquals("1.0.0", demoServiceMeta.get("version")); From d8ad05f3e9ea83e0bff343727135d190f9d00bbf Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 18 Dec 2018 21:02:01 +0800 Subject: [PATCH 10/18] Fix plugins' issues --- README.md | 18 +- README_CN.md | 36 ++- dubbo-spring-boot-actuator/README.md | 2 +- dubbo-spring-boot-actuator/README_CN.md | 4 +- dubbo-spring-boot-actuator/pom.xml | 19 +- .../DubboEndpointAutoConfiguration.java | 3 + ...ndpointManagementContextConfiguration.java | 2 +- .../endpoint/mvc/DubboMvcEndpoint.java | 1 - .../DubboHealthIndicatorProperties.java | 2 +- dubbo-spring-boot-autoconfigure/README.md | 2 +- dubbo-spring-boot-autoconfigure/pom.xml | 19 +- .../autoconfigure/DubboAutoConfiguration.java | 10 +- ...verrideDubboConfigApplicationListener.java | 7 +- .../event/WelcomeLogoApplicationListener.java | 9 +- .../alibaba/boot/dubbo/util/DubboUtils.java | 13 +- .../boot/dubbo/util/DubboUtilsTest.java | 27 +- dubbo-spring-boot-parent/pom.xml | 249 +++++++++++++++++- .../dubbo-spring-boot-sample-api/pom.xml | 19 +- .../dubbo-spring-boot-sample-consumer/pom.xml | 19 +- .../controller/DemoConsumerController.java | 1 - .../dubbo-spring-boot-sample-provider/pom.xml | 19 +- dubbo-spring-boot-samples/pom.xml | 19 +- dubbo-spring-boot-starter/pom.xml | 19 +- pom.xml | 2 +- 24 files changed, 451 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 7a0b7c3b0..057bd97c8 100644 --- a/README.md +++ b/README.md @@ -19,18 +19,29 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by addi ```xml + ... + com.alibaba.boot dubbo-spring-boot-starter - 0.1.2 + 0.1.2-SNAPSHOT + com.alibaba dubbo - [2.6.5,) + 2.6.5 + + + + com.alibaba.spring + spring-context-support + 1.0.2 + ... + ``` @@ -57,8 +68,7 @@ If your project failed to resolve the dependency, try to add the following repos If you'd like to attempt to experience latest features, you also can build from source as follow: -1. Maven install [dubbo 2.6.2-SNAPSHOT](https://github.com/apache/incubator-dubbo/tree/2.6.2-release) in your local repository -2. Maven install current project in your local repository. +1. Maven install current project in your local repository. > Maven install = `mvn install` ### Dependencies diff --git a/README_CN.md b/README_CN.md index e80135c97..ea8dfcf74 100644 --- a/README_CN.md +++ b/README_CN.md @@ -18,11 +18,32 @@ 您可以为您的工程引入最新 `dubbo-spring-boot-starter` 的发布,增加以下依赖到工程的 `pom.xml` 文件中: ```xml - - com.alibaba.boot - dubbo-spring-boot-starter - 0.1.0 - + + + ... + + + com.alibaba.boot + dubbo-spring-boot-starter + 0.1.2-SNAPSHOT + + + + + com.alibaba + dubbo + 2.6.5 + + + + com.alibaba.spring + spring-context-support + 1.0.2 + + + ... + + ``` 如果您的工程遇到了依赖问题, 请尝试添加如下 Maven 参考到工程的 `pom.xml` 文件中: @@ -48,15 +69,14 @@ 如果你需要尝试最新 `dubbo-spring-boot-project` 的特性,您可将当前工程手动 Maven install 到本地 Maven 仓库: -1. Maven install [dubbo 2.6.2-SNAPSHOT](https://github.com/apache/incubator-dubbo/tree/2.6.2-release) -2. Maven install 当前工程 +1. Maven install 当前工程 > Maven install = `mvn install` ### 依赖关系 | 版本 | Java | Spring Boot | Dubbo | | -------- | ----- | ----------------- | ---------- | -| `0.1.2` | 1.7+ | `1.5.x` | `2.6.x`+ | +| `0.1.x` | 1.7+ | `1.5.x` | `2.6.x`+ | diff --git a/dubbo-spring-boot-actuator/README.md b/dubbo-spring-boot-actuator/README.md index e92dcc4ed..2b61aa144 100644 --- a/dubbo-spring-boot-actuator/README.md +++ b/dubbo-spring-boot-actuator/README.md @@ -21,7 +21,7 @@ You can introduce the latest `dubbo-spring-boot-actuator` to your project by ad com.alibaba.boot dubbo-spring-boot-actuator - 0.1.2 + 0.1.2-SNAPSHOT ``` If your project failed to resolve the dependency, try to add the following repository: diff --git a/dubbo-spring-boot-actuator/README_CN.md b/dubbo-spring-boot-actuator/README_CN.md index a40de6dd1..9e6780dd5 100644 --- a/dubbo-spring-boot-actuator/README_CN.md +++ b/dubbo-spring-boot-actuator/README_CN.md @@ -31,14 +31,14 @@ com.alibaba.boot dubbo-spring-boot-starter - 0.1.2 + 0.1.2-SNAPSHOT com.alibaba.boot dubbo-spring-boot-actuator - 0.1.2 + 0.1.2-SNAPSHOT ... diff --git a/dubbo-spring-boot-actuator/pom.xml b/dubbo-spring-boot-actuator/pom.xml index 760aaeaa9..09fff8829 100644 --- a/dubbo-spring-boot-actuator/pom.xml +++ b/dubbo-spring-boot-actuator/pom.xml @@ -1,11 +1,26 @@ - + dubbo-spring-boot-parent com.alibaba.boot - 0.1.2 + 0.1.2-SNAPSHOT ../dubbo-spring-boot-parent/pom.xml 4.0.0 diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboEndpointAutoConfiguration.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboEndpointAutoConfiguration.java index 61ff57f0e..b7e6274dc 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboEndpointAutoConfiguration.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboEndpointAutoConfiguration.java @@ -18,6 +18,8 @@ import com.alibaba.boot.dubbo.actuate.endpoint.DubboEndpoint; import com.alibaba.dubbo.config.annotation.Service; + +import org.springframework.boot.actuate.condition.ConditionalOnEnabledEndpoint; import org.springframework.boot.actuate.endpoint.Endpoint; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -37,6 +39,7 @@ public class DubboEndpointAutoConfiguration { @Bean @ConditionalOnMissingBean + @ConditionalOnEnabledEndpoint(value = "dubbo", enabledByDefault = false) public DubboEndpoint dubboEndpoint() { return new DubboEndpoint(); } diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java index 18a44a145..f4f1c6bc4 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java @@ -19,6 +19,7 @@ import com.alibaba.boot.dubbo.actuate.endpoint.DubboEndpoint; import com.alibaba.boot.dubbo.actuate.endpoint.mvc.DubboMvcEndpoint; import com.alibaba.dubbo.config.annotation.Service; + import org.springframework.boot.actuate.autoconfigure.ManagementContextConfiguration; import org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter; import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; @@ -31,7 +32,6 @@ * Dubbo {@link MvcEndpoint} {@link ManagementContextConfiguration} * * @author Mercy - * @see * @since 1.0.0 */ @ManagementContextConfiguration diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpoint.java index 7b324ca5d..e5c74e2b9 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpoint.java @@ -84,7 +84,6 @@ * {@link MvcEndpoint} to expose Dubbo Metadata * * @author Mercy - * @see * @since 1.0.0 */ public class DubboMvcEndpoint extends EndpointMvcAdapter implements ApplicationContextAware, EnvironmentAware { diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicatorProperties.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicatorProperties.java index bd35ed996..2ba7da2db 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicatorProperties.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicatorProperties.java @@ -17,6 +17,7 @@ package com.alibaba.boot.dubbo.actuate.health; import com.alibaba.dubbo.common.status.StatusChecker; + import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -53,7 +54,6 @@ public void setStatus(Status status) { /** * The nested class for {@link StatusChecker}'s names - *

*

      * registry=com.alibaba.dubbo.registry.status.RegistryStatusChecker
      * spring=com.alibaba.dubbo.config.spring.status.SpringStatusChecker
diff --git a/dubbo-spring-boot-autoconfigure/README.md b/dubbo-spring-boot-autoconfigure/README.md
index a3e257c32..ec39c1db2 100644
--- a/dubbo-spring-boot-autoconfigure/README.md
+++ b/dubbo-spring-boot-autoconfigure/README.md
@@ -23,7 +23,7 @@ You can introduce the latest `dubbo-spring-boot-autoconfigure` to your project
 
     com.alibaba.boot
     dubbo-spring-boot-autoconfigure
-    0.1.2
+    0.1.2-SNAPSHOT
 
 ```
 
diff --git a/dubbo-spring-boot-autoconfigure/pom.xml b/dubbo-spring-boot-autoconfigure/pom.xml
index d79f4d86a..7fb95a547 100644
--- a/dubbo-spring-boot-autoconfigure/pom.xml
+++ b/dubbo-spring-boot-autoconfigure/pom.xml
@@ -1,11 +1,26 @@
-
+
 
     
         com.alibaba.boot
         dubbo-spring-boot-parent
-        0.1.2
+        0.1.2-SNAPSHOT
         ../dubbo-spring-boot-parent
     
     4.0.0
diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java
index 251934af0..21a86bcf7 100644
--- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java
+++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java
@@ -26,6 +26,7 @@
 import com.alibaba.dubbo.config.spring.context.annotation.DubboConfigConfiguration;
 import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
 import com.alibaba.dubbo.config.spring.context.annotation.EnableDubboConfig;
+
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -38,7 +39,9 @@
 
 import java.util.Set;
 
-import static com.alibaba.boot.dubbo.util.DubboUtils.*;
+import static com.alibaba.boot.dubbo.util.DubboUtils.BASE_PACKAGES_PROPERTY_NAME;
+import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_PREFIX;
+import static com.alibaba.boot.dubbo.util.DubboUtils.MULTIPLE_CONFIG_PROPERTY_NAME;
 import static java.util.Collections.emptySet;
 import static org.springframework.beans.factory.config.ConfigurableBeanFactory.SCOPE_PROTOTYPE;
 
@@ -70,9 +73,9 @@ protected static class SingleDubboConfigConfiguration {
     }
 
     /**
-     * Multiple Dubbo Config Configuration , equals {@link EnableDubboConfig#multiple()} == true
+     * Multiple Dubbo Config Configuration , equals @EnableDubboConfig.multiple() == true
      *
-     * @see EnableDubboConfig#multiple()
+     * @see EnableDubboConfig
      * @see DubboConfigConfiguration.Multiple
      */
     @ConditionalOnProperty(name = MULTIPLE_CONFIG_PROPERTY_NAME, havingValue = "true")
@@ -83,6 +86,7 @@ protected static class MultipleDubboConfigConfiguration {
     /**
      * Creates {@link ServiceAnnotationBeanPostProcessor} Bean
      *
+     * @param environment {@link Environment}
      * @return {@link ServiceAnnotationBeanPostProcessor}
      */
     @ConditionalOnProperty(name = BASE_PACKAGES_PROPERTY_NAME)
diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListener.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListener.java
index 08135c6af..8f9cfbaa0 100644
--- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListener.java
+++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListener.java
@@ -17,6 +17,7 @@
 package com.alibaba.boot.dubbo.context.event;
 
 import com.alibaba.dubbo.common.utils.ConfigUtils;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
@@ -27,12 +28,14 @@
 
 import java.util.SortedMap;
 
-import static com.alibaba.boot.dubbo.util.DubboUtils.*;
+import static com.alibaba.boot.dubbo.util.DubboUtils.DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE;
+import static com.alibaba.boot.dubbo.util.DubboUtils.OVERRIDE_CONFIG_PROPERTY_NAME;
+import static com.alibaba.boot.dubbo.util.DubboUtils.filterDubboProperties;
 
 /**
  * {@link ApplicationListener} to override the dubbo properties from {@link Environment}into
  * {@link ConfigUtils#getProperties() Dubbo Config}.
- * {@ConfigUtils Dubbo Config} on {@link ApplicationEnvironmentPreparedEvent}.
+ * {@link ConfigUtils Dubbo Config} on {@link ApplicationEnvironmentPreparedEvent}.
  * 

* * @author Mercy diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java index 850485721..ea2b80248 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java @@ -17,6 +17,7 @@ package com.alibaba.boot.dubbo.context.event; import com.alibaba.dubbo.common.Version; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; @@ -24,14 +25,16 @@ import org.springframework.context.ApplicationListener; import org.springframework.core.annotation.Order; -import static com.alibaba.boot.dubbo.util.DubboUtils.*; -import static com.alibaba.dubbo.qos.server.DubboLogo.dubbo; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GITHUB_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GOOGLE_GROUP_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SPRING_BOOT_GITHUB_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.LINE_SEPARATOR; /** * Dubbo Welcome Logo {@link ApplicationListener} * * @author Mercy - * @see + * @see ApplicationListener * @since 1.0.0 */ @Order(LoggingApplicationListener.DEFAULT_ORDER + 1) diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java index 4654cd168..eef055f85 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java @@ -27,7 +27,6 @@ * The utilities class for Dubbo * * @author Mercy - * @see * @since 1.0.0 */ public abstract class DubboUtils { @@ -63,7 +62,7 @@ public abstract class DubboUtils { *

* The default value is empty set. */ - public static final String BASE_PACKAGES_PROPERTY_NAME = DUBBO_SCAN_PREFIX + PROPERTY_NAME_SEPARATOR + "basePackages"; + public static final String BASE_PACKAGES_PROPERTY_NAME = DUBBO_SCAN_PREFIX + PROPERTY_NAME_SEPARATOR + "base-packages"; /** * The property name of multiple properties binding from externalized configuration @@ -93,27 +92,27 @@ public abstract class DubboUtils { /** * The github URL of Dubbo Spring Boot */ - public static final String DUBBO_SPRING_BOOT_GITHUB_URL = "https://github.com/dubbo/dubbo-spring-boot-project"; + public static final String DUBBO_SPRING_BOOT_GITHUB_URL = "https://github.com/apache/incubator-dubbo-spring-boot-project"; /** * The git URL of Dubbo Spring Boot */ - public static final String DUBBO_SPRING_BOOT_GIT_URL = "https://github.com/dubbo/dubbo-spring-boot-project.git"; + public static final String DUBBO_SPRING_BOOT_GIT_URL = "https://github.com/apache/incubator-dubbo-spring-boot-project.git"; /** * The issues of Dubbo Spring Boot */ - public static final String DUBBO_SPRING_BOOT_ISSUES_URL = "https://github.com/dubbo/dubbo-spring-boot-project/issues"; + public static final String DUBBO_SPRING_BOOT_ISSUES_URL = "https://github.com/apache/incubator-dubbo-spring-boot-project/issues"; /** * The github URL of Dubbo */ - public static final String DUBBO_GITHUB_URL = "https://github.com/alibaba/dubbo"; + public static final String DUBBO_GITHUB_URL = "https://github.com/apache/incubator-dubbo"; /** * The google group URL of Dubbo */ - public static final String DUBBO_GOOGLE_GROUP_URL = "http://groups.google.com/group/dubbo"; + public static final String DUBBO_GOOGLE_GROUP_URL = "dev@dubbo.incubator.apache.org"; /** * Filters Dubbo Properties from {@link ConfigurableEnvironment} diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java index f0e10b9f3..4c557f54e 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java @@ -22,7 +22,20 @@ import java.util.SortedMap; -import static com.alibaba.boot.dubbo.util.DubboUtils.*; +import static com.alibaba.boot.dubbo.util.DubboUtils.BASE_PACKAGES_PROPERTY_NAME; +import static com.alibaba.boot.dubbo.util.DubboUtils.DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE; +import static com.alibaba.boot.dubbo.util.DubboUtils.DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_CONFIG_PREFIX; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GITHUB_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GOOGLE_GROUP_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_PREFIX; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SCAN_PREFIX; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SPRING_BOOT_GITHUB_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SPRING_BOOT_GIT_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SPRING_BOOT_ISSUES_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.MULTIPLE_CONFIG_PROPERTY_NAME; +import static com.alibaba.boot.dubbo.util.DubboUtils.OVERRIDE_CONFIG_PROPERTY_NAME; +import static com.alibaba.boot.dubbo.util.DubboUtils.filterDubboProperties; /** * {@link DubboUtils} Test @@ -40,7 +53,7 @@ public void testConstants() { Assert.assertEquals("dubbo.scan", DUBBO_SCAN_PREFIX); - Assert.assertEquals("dubbo.scan.basePackages", BASE_PACKAGES_PROPERTY_NAME); + Assert.assertEquals("dubbo.scan.base-packages", BASE_PACKAGES_PROPERTY_NAME); Assert.assertEquals("dubbo.config", DUBBO_CONFIG_PREFIX); @@ -48,13 +61,13 @@ public void testConstants() { Assert.assertEquals("dubbo.config.override", OVERRIDE_CONFIG_PROPERTY_NAME); - Assert.assertEquals("https://github.com/dubbo/dubbo-spring-boot-project", DUBBO_SPRING_BOOT_GITHUB_URL); - Assert.assertEquals("https://github.com/dubbo/dubbo-spring-boot-project.git", DUBBO_SPRING_BOOT_GIT_URL); - Assert.assertEquals("https://github.com/dubbo/dubbo-spring-boot-project/issues", DUBBO_SPRING_BOOT_ISSUES_URL); + Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project", DUBBO_SPRING_BOOT_GITHUB_URL); + Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project.git", DUBBO_SPRING_BOOT_GIT_URL); + Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project/issues", DUBBO_SPRING_BOOT_ISSUES_URL); - Assert.assertEquals("https://github.com/alibaba/dubbo", DUBBO_GITHUB_URL); + Assert.assertEquals("https://github.com/apache/incubator-dubbo", DUBBO_GITHUB_URL); - Assert.assertEquals("http://groups.google.com/group/dubbo", DUBBO_GOOGLE_GROUP_URL); + Assert.assertEquals("dev@dubbo.incubator.apache.org", DUBBO_GOOGLE_GROUP_URL); Assert.assertFalse(DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE); diff --git a/dubbo-spring-boot-parent/pom.xml b/dubbo-spring-boot-parent/pom.xml index 7fd4a4d7e..94cf21775 100644 --- a/dubbo-spring-boot-parent/pom.xml +++ b/dubbo-spring-boot-parent/pom.xml @@ -1,11 +1,26 @@ - + com.alibaba.boot dubbo-spring-boot-project - 0.1.2 + 0.1.2-SNAPSHOT ../pom.xml @@ -18,6 +33,8 @@ 1.7 + 1.7 + 1.7 UTF-8 UTF-8 1.5.18.RELEASE @@ -28,11 +45,21 @@ 1.0.2 + + -server -Xms256m -Xmx512m -XX:PermSize=64m -XX:MaxPermSize=128m -Dfile.encoding=UTF-8 + -Djava.net.preferIPv4Stack=true + + + + + 3.0.2 + 3.6.0 + 3.0.1 + 0.8.1 1.5 - 3.0.2 - 3.6.0 - 3.0.1 - 3.0.0-M1 + 0.12 + 2.5.3 + 2.19.1 @@ -184,11 +211,36 @@ + + + + src/main/resources/ + false + + + ../ + META-INF/ + false + + NOTICE + LICENSE + + + + ../../ + META-INF/ + false + + NOTICE + LICENSE + + + org.apache.maven.plugins maven-jar-plugin - ${maven-jar.version} + ${maven-jar-plugin.version} true @@ -197,22 +249,54 @@ true true + + ${project.version} + ${project.version} + + org.apache.maven.plugins maven-compiler-plugin - ${maven-compiler.version} + ${maven-compiler-plugin.version} - ${java.version} - ${java.version} + -proc:none + true + ${java.source.version} + ${java.target.version} + ${file.encoding} + + + org.jacoco + jacoco-maven-plugin + ${maven-jacoco-plugin.version} + + + jacoco-initialize + + prepare-agent + + + jacocoArgLine + + + + jacoco-site + package + + report + + + + + org.apache.maven.plugins maven-enforcer-plugin - ${maven-enforcer.version} enforce-rules @@ -222,7 +306,7 @@ - [1.7,) + [1.8,) project.name @@ -239,7 +323,7 @@ org.apache.maven.plugins maven-source-plugin - ${maven-source.version} + ${maven-source-plugin.version} attach-sources @@ -249,6 +333,145 @@ + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + true + once + ${argline} ${jacocoArgLine} + + + + transporter + ${transporter} + + + serialization + ${serialization} + + + + port + ${port} + + + threadpool + ${threadpool} + + + threads + ${threads} + + + iothreads + ${iothreads} + + + + server + ${server} + + + timeout + ${timeout} + + + length + ${length} + + + connections + ${connections} + + + base + ${base} + + + concurrent + ${concurrent} + + + runs + ${runs} + + + onerror + ${onerror} + + + + + + org.apache.rat + apache-rat-plugin + ${apache-rat-plugin.version} + + + verify.rat + verify + + check + + + + **/*.versionsBackup + **/.idea/ + **/*.iml + **/*.txt + **/*.load + **/*.flex + **/*.fc + **/*.javascript + **/*.properties + **/*.yml + **/*.yaml + **/*.thrift + **/*.sh + **/*.bat + **/*.md + .git/ + .gitignore + + .repository/ + **/.settings/* + **/.classpath + **/.project + **/target/** + **/*.log + CODE_OF_CONDUCT.md + .codecov.yml + .travis.yml + PULL_REQUEST_TEMPLATE.md + CONTRIBUTING.md + README.md + README_CN.md + **/codestyle/* + **/resources/META-INF/** + **/*.factories + **/*.provides + **/*.properties + **/*.json + + + + + + + + org.apache.maven.plugins + maven-release-plugin + ${maven-release-plugin.version} + + true + false + release + deploy + ${arguments} + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml index 5df80600c..baf5da24d 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml @@ -1,11 +1,26 @@ - + com.alibaba.boot dubbo-spring-boot-samples - 0.1.2 + 0.1.2-SNAPSHOT ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml index c130b5f94..3637b7234 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml @@ -1,11 +1,26 @@ - + com.alibaba.boot dubbo-spring-boot-samples - 0.1.2 + 0.1.2-SNAPSHOT ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java index f125b23bd..247394db7 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java @@ -27,7 +27,6 @@ * Demo Consumer Controller (REST) * * @author Mercy - * @see * @since 1.0.0 */ @RestController diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml index 41fa73ae7..97365d7ef 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml @@ -1,11 +1,26 @@ - + com.alibaba.boot dubbo-spring-boot-samples - 0.1.2 + 0.1.2-SNAPSHOT ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/pom.xml b/dubbo-spring-boot-samples/pom.xml index a1ce4d5c7..28aab4495 100644 --- a/dubbo-spring-boot-samples/pom.xml +++ b/dubbo-spring-boot-samples/pom.xml @@ -1,11 +1,26 @@ - + com.alibaba.boot dubbo-spring-boot-parent - 0.1.2 + 0.1.2-SNAPSHOT ../dubbo-spring-boot-parent/pom.xml 4.0.0 diff --git a/dubbo-spring-boot-starter/pom.xml b/dubbo-spring-boot-starter/pom.xml index 425c96a55..43273b6e6 100644 --- a/dubbo-spring-boot-starter/pom.xml +++ b/dubbo-spring-boot-starter/pom.xml @@ -1,11 +1,26 @@ - + com.alibaba.boot dubbo-spring-boot-parent - 0.1.2 + 0.1.2-SNAPSHOT ../dubbo-spring-boot-parent 4.0.0 diff --git a/pom.xml b/pom.xml index dea9ad3df..93c5f8162 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.alibaba.boot dubbo-spring-boot-project - 0.1.2 + 0.1.2-SNAPSHOT pom From 5149000f6c800a24fdf22deed7521deb4389e1c2 Mon Sep 17 00:00:00 2001 From: "taogu.mxx" Date: Tue, 18 Dec 2018 22:09:57 +0800 Subject: [PATCH 11/18] Fix test-cases --- README.md | 2 +- README_CN.md | 2 +- dubbo-spring-boot-actuator/README.md | 2 +- dubbo-spring-boot-actuator/README_CN.md | 2 +- .../boot/dubbo/actuate/endpoint/DubboEndpoint.java | 2 +- .../boot/dubbo/actuate/endpoint/DubboEndpointTest.java | 10 +++++----- .../actuate/endpoint/mvc/DubboMvcEndpointTest.java | 4 ++-- .../context/event/WelcomeLogoApplicationListener.java | 6 +++--- .../java/com/alibaba/boot/dubbo/util/DubboUtils.java | 4 ++-- .../com/alibaba/boot/dubbo/util/DubboUtilsTest.java | 6 +++--- dubbo-spring-boot-parent/pom.xml | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 9400c1fb3..42af4d86b 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ management.port = 9091 demo.service.version = 1.0.0 # Base packages to scan Dubbo Components (e.g @Service , @Reference) -dubbo.scan.basePackages = com.alibaba.boot.dubbo.demo.provider.service +dubbo.scan.base-packages = com.alibaba.boot.dubbo.demo.provider.service # Dubbo Config properties ## ApplicationConfig Bean diff --git a/README_CN.md b/README_CN.md index ea8dfcf74..2e87dbdf3 100644 --- a/README_CN.md +++ b/README_CN.md @@ -150,7 +150,7 @@ management.port = 9091 demo.service.version = 1.0.0 # Base packages to scan Dubbo Components (e.g @Service , @Reference) -dubbo.scan.basePackages = com.alibaba.boot.dubbo.demo.provider.service +dubbo.scan.base-packages = com.alibaba.boot.dubbo.demo.provider.service # Dubbo Config properties ## ApplicationConfig Bean diff --git a/dubbo-spring-boot-actuator/README.md b/dubbo-spring-boot-actuator/README.md index 2b61aa144..abcefe0bc 100644 --- a/dubbo-spring-boot-actuator/README.md +++ b/dubbo-spring-boot-actuator/README.md @@ -195,7 +195,7 @@ Actuator endpoint `dubbo` supports Spring Web MVC Endpoints : "dubbo.protocol.port": "12345", "dubbo.registry.address": "N/A", "dubbo.registry.id": "my-registry", - "dubbo.scan.basePackages": "com.alibaba.boot.dubbo.demo.provider.service" + "dubbo.scan.base-packages": "com.alibaba.boot.dubbo.demo.provider.service" } ``` diff --git a/dubbo-spring-boot-actuator/README_CN.md b/dubbo-spring-boot-actuator/README_CN.md index 9e6780dd5..408077d41 100644 --- a/dubbo-spring-boot-actuator/README_CN.md +++ b/dubbo-spring-boot-actuator/README_CN.md @@ -200,7 +200,7 @@ Actuator endpoint `dubbo` supports Spring Web MVC Endpoints : "dubbo.protocol.port": "12345", "dubbo.registry.address": "N/A", "dubbo.registry.id": "my-registry", - "dubbo.scan.basePackages": "com.alibaba.boot.dubbo.demo.provider.service" + "dubbo.scan.base-packages": "com.alibaba.boot.dubbo.demo.provider.service" } ``` diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java index d96821d78..4b3199ec4 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java @@ -64,7 +64,7 @@ public Map invoke() { Map urls = new LinkedHashMap<>(); urls.put("dubbo", DUBBO_GITHUB_URL); - urls.put("google-group", DUBBO_GOOGLE_GROUP_URL); + urls.put("mailing-list", DUBBO_MAILING_LIST); urls.put("github", DUBBO_SPRING_BOOT_GITHUB_URL); urls.put("issues", DUBBO_SPRING_BOOT_ISSUES_URL); urls.put("git", DUBBO_SPRING_BOOT_GIT_URL); diff --git a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointTest.java b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointTest.java index 16eef99e2..1c5e4cf7f 100644 --- a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointTest.java +++ b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointTest.java @@ -72,11 +72,11 @@ public void testInvoke() { Assert.assertEquals(getVersion(DubboUtils.class, "1.0.0"), versions.get("dubbo-spring-boot")); Assert.assertEquals(getVersion(), versions.get("dubbo")); - Assert.assertEquals("https://github.com/alibaba/dubbo", urls.get("dubbo")); - Assert.assertEquals("http://groups.google.com/group/dubbo", urls.get("google-group")); - Assert.assertEquals("https://github.com/dubbo/dubbo-spring-boot-project", urls.get("github")); - Assert.assertEquals("https://github.com/dubbo/dubbo-spring-boot-project/issues", urls.get("issues")); - Assert.assertEquals("https://github.com/dubbo/dubbo-spring-boot-project.git", urls.get("git")); + Assert.assertEquals("https://github.com/apache/incubator-dubbo", urls.get("dubbo")); + Assert.assertEquals("dev@dubbo.incubator.apache.org", urls.get("mailing-list")); + Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project", urls.get("github")); + Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project/issues", urls.get("issues")); + Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project.git", urls.get("git")); } diff --git a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java index 7b242fab0..e8e9c38cb 100644 --- a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java +++ b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java @@ -54,7 +54,7 @@ "dubbo.protocol.port=20880", "dubbo.provider.id=my-provider", "dubbo.provider.host=127.0.0.1", - "dubbo.scan.basePackages=com.alibaba.boot.dubbo.actuate.endpoint.mvc" + "dubbo.scan.base-packages=com.alibaba.boot.dubbo.actuate.endpoint.mvc" } ) @SpringBootTest( @@ -166,7 +166,7 @@ public void testProperties() { Assert.assertEquals("20880", properties.get("dubbo.protocol.port")); Assert.assertEquals("my-provider", properties.get("dubbo.provider.id")); Assert.assertEquals("127.0.0.1", properties.get("dubbo.provider.host")); - Assert.assertEquals("com.alibaba.boot.dubbo.actuate.endpoint.mvc", properties.get("dubbo.scan.basePackages")); + Assert.assertEquals("com.alibaba.boot.dubbo.actuate.endpoint.mvc", properties.get("dubbo.scan.base-packages")); } diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java index ea2b80248..de4d8c228 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java @@ -26,7 +26,7 @@ import org.springframework.core.annotation.Order; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GITHUB_URL; -import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GOOGLE_GROUP_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_MAILING_LIST; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SPRING_BOOT_GITHUB_URL; import static com.alibaba.boot.dubbo.util.DubboUtils.LINE_SEPARATOR; @@ -74,8 +74,8 @@ String buildBannerText() { .append(" :: Dubbo (v").append(Version.getVersion()).append(") : ") .append(DUBBO_GITHUB_URL) .append(LINE_SEPARATOR) - .append(" :: Google group : ") - .append(DUBBO_GOOGLE_GROUP_URL) + .append(" :: Mailing List : ") + .append(DUBBO_MAILING_LIST) .append(LINE_SEPARATOR) ; diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java index eef055f85..71fac05d5 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java @@ -110,9 +110,9 @@ public abstract class DubboUtils { public static final String DUBBO_GITHUB_URL = "https://github.com/apache/incubator-dubbo"; /** - * The google group URL of Dubbo + * The dubbo mailing List */ - public static final String DUBBO_GOOGLE_GROUP_URL = "dev@dubbo.incubator.apache.org"; + public static final String DUBBO_MAILING_LIST = "dev@dubbo.incubator.apache.org"; /** * Filters Dubbo Properties from {@link ConfigurableEnvironment} diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java index 4c557f54e..40fd6bc3c 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java @@ -27,7 +27,7 @@ import static com.alibaba.boot.dubbo.util.DubboUtils.DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_CONFIG_PREFIX; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GITHUB_URL; -import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GOOGLE_GROUP_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_MAILING_LIST; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_PREFIX; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SCAN_PREFIX; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SPRING_BOOT_GITHUB_URL; @@ -39,7 +39,7 @@ /** * {@link DubboUtils} Test - * + *Ø * @author Mercy * @see DubboUtils * @since 1.0.0 @@ -67,7 +67,7 @@ public void testConstants() { Assert.assertEquals("https://github.com/apache/incubator-dubbo", DUBBO_GITHUB_URL); - Assert.assertEquals("dev@dubbo.incubator.apache.org", DUBBO_GOOGLE_GROUP_URL); + Assert.assertEquals("dev@dubbo.incubator.apache.org", DUBBO_MAILING_LIST); Assert.assertFalse(DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE); diff --git a/dubbo-spring-boot-parent/pom.xml b/dubbo-spring-boot-parent/pom.xml index 0e816c250..dae76a11f 100644 --- a/dubbo-spring-boot-parent/pom.xml +++ b/dubbo-spring-boot-parent/pom.xml @@ -305,7 +305,7 @@ - [1.8,) + [1.7,) project.name From d8fb065bfcd2f15b16eda6f05e73a29926e80ba5 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 18 Dec 2018 22:12:22 +0800 Subject: [PATCH 12/18] Fix test cases --- README.md | 2 +- README_CN.md | 2 +- dubbo-spring-boot-actuator/README.md | 2 +- dubbo-spring-boot-actuator/README_CN.md | 2 +- .../boot/dubbo/actuate/endpoint/DubboEndpoint.java | 2 +- .../boot/dubbo/actuate/endpoint/DubboEndpointTest.java | 10 +++++----- .../actuate/endpoint/mvc/DubboMvcEndpointTest.java | 4 ++-- .../context/event/WelcomeLogoApplicationListener.java | 6 +++--- .../java/com/alibaba/boot/dubbo/util/DubboUtils.java | 4 ++-- .../com/alibaba/boot/dubbo/util/DubboUtilsTest.java | 6 +++--- dubbo-spring-boot-parent/pom.xml | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 9400c1fb3..42af4d86b 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ management.port = 9091 demo.service.version = 1.0.0 # Base packages to scan Dubbo Components (e.g @Service , @Reference) -dubbo.scan.basePackages = com.alibaba.boot.dubbo.demo.provider.service +dubbo.scan.base-packages = com.alibaba.boot.dubbo.demo.provider.service # Dubbo Config properties ## ApplicationConfig Bean diff --git a/README_CN.md b/README_CN.md index ea8dfcf74..2e87dbdf3 100644 --- a/README_CN.md +++ b/README_CN.md @@ -150,7 +150,7 @@ management.port = 9091 demo.service.version = 1.0.0 # Base packages to scan Dubbo Components (e.g @Service , @Reference) -dubbo.scan.basePackages = com.alibaba.boot.dubbo.demo.provider.service +dubbo.scan.base-packages = com.alibaba.boot.dubbo.demo.provider.service # Dubbo Config properties ## ApplicationConfig Bean diff --git a/dubbo-spring-boot-actuator/README.md b/dubbo-spring-boot-actuator/README.md index 2b61aa144..abcefe0bc 100644 --- a/dubbo-spring-boot-actuator/README.md +++ b/dubbo-spring-boot-actuator/README.md @@ -195,7 +195,7 @@ Actuator endpoint `dubbo` supports Spring Web MVC Endpoints : "dubbo.protocol.port": "12345", "dubbo.registry.address": "N/A", "dubbo.registry.id": "my-registry", - "dubbo.scan.basePackages": "com.alibaba.boot.dubbo.demo.provider.service" + "dubbo.scan.base-packages": "com.alibaba.boot.dubbo.demo.provider.service" } ``` diff --git a/dubbo-spring-boot-actuator/README_CN.md b/dubbo-spring-boot-actuator/README_CN.md index 9e6780dd5..408077d41 100644 --- a/dubbo-spring-boot-actuator/README_CN.md +++ b/dubbo-spring-boot-actuator/README_CN.md @@ -200,7 +200,7 @@ Actuator endpoint `dubbo` supports Spring Web MVC Endpoints : "dubbo.protocol.port": "12345", "dubbo.registry.address": "N/A", "dubbo.registry.id": "my-registry", - "dubbo.scan.basePackages": "com.alibaba.boot.dubbo.demo.provider.service" + "dubbo.scan.base-packages": "com.alibaba.boot.dubbo.demo.provider.service" } ``` diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java index d96821d78..4b3199ec4 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java @@ -64,7 +64,7 @@ public Map invoke() { Map urls = new LinkedHashMap<>(); urls.put("dubbo", DUBBO_GITHUB_URL); - urls.put("google-group", DUBBO_GOOGLE_GROUP_URL); + urls.put("mailing-list", DUBBO_MAILING_LIST); urls.put("github", DUBBO_SPRING_BOOT_GITHUB_URL); urls.put("issues", DUBBO_SPRING_BOOT_ISSUES_URL); urls.put("git", DUBBO_SPRING_BOOT_GIT_URL); diff --git a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointTest.java b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointTest.java index 16eef99e2..1c5e4cf7f 100644 --- a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointTest.java +++ b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointTest.java @@ -72,11 +72,11 @@ public void testInvoke() { Assert.assertEquals(getVersion(DubboUtils.class, "1.0.0"), versions.get("dubbo-spring-boot")); Assert.assertEquals(getVersion(), versions.get("dubbo")); - Assert.assertEquals("https://github.com/alibaba/dubbo", urls.get("dubbo")); - Assert.assertEquals("http://groups.google.com/group/dubbo", urls.get("google-group")); - Assert.assertEquals("https://github.com/dubbo/dubbo-spring-boot-project", urls.get("github")); - Assert.assertEquals("https://github.com/dubbo/dubbo-spring-boot-project/issues", urls.get("issues")); - Assert.assertEquals("https://github.com/dubbo/dubbo-spring-boot-project.git", urls.get("git")); + Assert.assertEquals("https://github.com/apache/incubator-dubbo", urls.get("dubbo")); + Assert.assertEquals("dev@dubbo.incubator.apache.org", urls.get("mailing-list")); + Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project", urls.get("github")); + Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project/issues", urls.get("issues")); + Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project.git", urls.get("git")); } diff --git a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java index 7b242fab0..e8e9c38cb 100644 --- a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java +++ b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java @@ -54,7 +54,7 @@ "dubbo.protocol.port=20880", "dubbo.provider.id=my-provider", "dubbo.provider.host=127.0.0.1", - "dubbo.scan.basePackages=com.alibaba.boot.dubbo.actuate.endpoint.mvc" + "dubbo.scan.base-packages=com.alibaba.boot.dubbo.actuate.endpoint.mvc" } ) @SpringBootTest( @@ -166,7 +166,7 @@ public void testProperties() { Assert.assertEquals("20880", properties.get("dubbo.protocol.port")); Assert.assertEquals("my-provider", properties.get("dubbo.provider.id")); Assert.assertEquals("127.0.0.1", properties.get("dubbo.provider.host")); - Assert.assertEquals("com.alibaba.boot.dubbo.actuate.endpoint.mvc", properties.get("dubbo.scan.basePackages")); + Assert.assertEquals("com.alibaba.boot.dubbo.actuate.endpoint.mvc", properties.get("dubbo.scan.base-packages")); } diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java index ea2b80248..de4d8c228 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java @@ -26,7 +26,7 @@ import org.springframework.core.annotation.Order; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GITHUB_URL; -import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GOOGLE_GROUP_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_MAILING_LIST; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SPRING_BOOT_GITHUB_URL; import static com.alibaba.boot.dubbo.util.DubboUtils.LINE_SEPARATOR; @@ -74,8 +74,8 @@ String buildBannerText() { .append(" :: Dubbo (v").append(Version.getVersion()).append(") : ") .append(DUBBO_GITHUB_URL) .append(LINE_SEPARATOR) - .append(" :: Google group : ") - .append(DUBBO_GOOGLE_GROUP_URL) + .append(" :: Mailing List : ") + .append(DUBBO_MAILING_LIST) .append(LINE_SEPARATOR) ; diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java index eef055f85..71fac05d5 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java @@ -110,9 +110,9 @@ public abstract class DubboUtils { public static final String DUBBO_GITHUB_URL = "https://github.com/apache/incubator-dubbo"; /** - * The google group URL of Dubbo + * The dubbo mailing List */ - public static final String DUBBO_GOOGLE_GROUP_URL = "dev@dubbo.incubator.apache.org"; + public static final String DUBBO_MAILING_LIST = "dev@dubbo.incubator.apache.org"; /** * Filters Dubbo Properties from {@link ConfigurableEnvironment} diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java index 4c557f54e..40fd6bc3c 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java @@ -27,7 +27,7 @@ import static com.alibaba.boot.dubbo.util.DubboUtils.DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_CONFIG_PREFIX; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GITHUB_URL; -import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GOOGLE_GROUP_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_MAILING_LIST; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_PREFIX; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SCAN_PREFIX; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SPRING_BOOT_GITHUB_URL; @@ -39,7 +39,7 @@ /** * {@link DubboUtils} Test - * + *Ø * @author Mercy * @see DubboUtils * @since 1.0.0 @@ -67,7 +67,7 @@ public void testConstants() { Assert.assertEquals("https://github.com/apache/incubator-dubbo", DUBBO_GITHUB_URL); - Assert.assertEquals("dev@dubbo.incubator.apache.org", DUBBO_GOOGLE_GROUP_URL); + Assert.assertEquals("dev@dubbo.incubator.apache.org", DUBBO_MAILING_LIST); Assert.assertFalse(DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE); diff --git a/dubbo-spring-boot-parent/pom.xml b/dubbo-spring-boot-parent/pom.xml index 0e816c250..dae76a11f 100644 --- a/dubbo-spring-boot-parent/pom.xml +++ b/dubbo-spring-boot-parent/pom.xml @@ -305,7 +305,7 @@ - [1.8,) + [1.7,) project.name From 696d2ad8af66f420a71a8873dad91d909136e3a1 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 18 Dec 2018 22:30:42 +0800 Subject: [PATCH 13/18] Fixes an issue on DubboMvcEndpoint --- .../DubboMvcEndpointManagementContextConfiguration.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java index 5bbd1f8b1..2a079e9ec 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java @@ -23,6 +23,7 @@ import org.springframework.boot.actuate.autoconfigure.ManagementContextConfiguration; import org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter; import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; @@ -41,10 +42,10 @@ public class DubboMvcEndpointManagementContextConfiguration { @Bean + @ConditionalOnBean(DubboEndpoint.class) @ConditionalOnMissingBean public DubboMvcEndpoint dubboMvcEndpoint(DubboEndpoint dubboEndpoint) { return new DubboMvcEndpoint(dubboEndpoint); } - } From bedf6864cfd2632a74d4952af456af4dc5851c2b Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 18 Dec 2018 23:36:16 +0800 Subject: [PATCH 14/18] Polish: Fix a relaxed property name issue --- .../autoconfigure/DubboAutoConfiguration.java | 8 ++++--- ...verrideDubboConfigApplicationListener.java | 6 ++--- .../alibaba/boot/dubbo/util/DubboUtils.java | 14 +++++------ .../boot/dubbo/util/DubboUtilsTest.java | 23 ++++++++++--------- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java index 11ea77783..781900c33 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java @@ -40,7 +40,9 @@ import java.util.Set; import static com.alibaba.boot.dubbo.util.DubboUtils.BASE_PACKAGES_PROPERTY_NAME; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_CONFIG_PREFIX; import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_PREFIX; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SCAN_PREFIX; import static com.alibaba.boot.dubbo.util.DubboUtils.MULTIPLE_CONFIG_PROPERTY_NAME; import static java.util.Collections.emptySet; import static org.springframework.beans.factory.config.ConfigurableBeanFactory.SCOPE_PROTOTYPE; @@ -78,7 +80,7 @@ protected static class SingleDubboConfigConfiguration { * @see EnableDubboConfig * @see DubboConfigConfiguration.Multiple */ - @ConditionalOnProperty(name = MULTIPLE_CONFIG_PROPERTY_NAME, havingValue = "true") + @ConditionalOnProperty(prefix = DUBBO_CONFIG_PREFIX, name = MULTIPLE_CONFIG_PROPERTY_NAME, havingValue = "true") @EnableDubboConfig(multiple = true) protected static class MultipleDubboConfigConfiguration { } @@ -89,11 +91,11 @@ protected static class MultipleDubboConfigConfiguration { * @param environment {@link Environment} Bean * @return {@link ServiceAnnotationBeanPostProcessor} */ - @ConditionalOnProperty(name = BASE_PACKAGES_PROPERTY_NAME) + @ConditionalOnProperty(prefix = DUBBO_SCAN_PREFIX, name = BASE_PACKAGES_PROPERTY_NAME) @ConditionalOnClass(RelaxedPropertyResolver.class) @Bean public ServiceAnnotationBeanPostProcessor serviceAnnotationBeanPostProcessor(Environment environment) { - RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(environment); + RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(environment, DUBBO_SCAN_PREFIX); Set packagesToScan = resolver.getProperty(BASE_PACKAGES_PROPERTY_NAME, Set.class, emptySet()); return new ServiceAnnotationBeanPostProcessor(packagesToScan); } diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListener.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListener.java index e39ea5050..283081b06 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListener.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListener.java @@ -17,7 +17,6 @@ package com.alibaba.boot.dubbo.context.event; import com.alibaba.dubbo.common.utils.ConfigUtils; - import com.alibaba.dubbo.config.AbstractConfig; import org.slf4j.Logger; @@ -31,6 +30,7 @@ import java.util.SortedMap; import static com.alibaba.boot.dubbo.util.DubboUtils.DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_CONFIG_PREFIX; import static com.alibaba.boot.dubbo.util.DubboUtils.OVERRIDE_CONFIG_PROPERTY_NAME; import static com.alibaba.boot.dubbo.util.DubboUtils.filterDubboProperties; @@ -57,8 +57,8 @@ public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) { ConfigurableEnvironment environment = event.getEnvironment(); - boolean override = environment.getProperty(OVERRIDE_CONFIG_PROPERTY_NAME, boolean.class, - DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE); + boolean override = environment.getProperty(DUBBO_CONFIG_PREFIX + OVERRIDE_CONFIG_PROPERTY_NAME, + boolean.class, DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE); if (override) { diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java index 71fac05d5..1c38c0d8a 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java @@ -45,31 +45,31 @@ public abstract class DubboUtils { /** * The prefix of property name of Dubbo */ - public static final String DUBBO_PREFIX = "dubbo"; + public static final String DUBBO_PREFIX = "dubbo" + PROPERTY_NAME_SEPARATOR; /** * The prefix of property name for Dubbo scan */ - public static final String DUBBO_SCAN_PREFIX = DUBBO_PREFIX + PROPERTY_NAME_SEPARATOR + "scan"; + public static final String DUBBO_SCAN_PREFIX = DUBBO_PREFIX + "scan" + PROPERTY_NAME_SEPARATOR; /** * The prefix of property name for Dubbo Config.ØØ */ - public static final String DUBBO_CONFIG_PREFIX = DUBBO_PREFIX + PROPERTY_NAME_SEPARATOR + "config"; + public static final String DUBBO_CONFIG_PREFIX = DUBBO_PREFIX + "config" + PROPERTY_NAME_SEPARATOR; /** * The property name of base packages to scan *

* The default value is empty set. */ - public static final String BASE_PACKAGES_PROPERTY_NAME = DUBBO_SCAN_PREFIX + PROPERTY_NAME_SEPARATOR + "base-packages"; + public static final String BASE_PACKAGES_PROPERTY_NAME = "base-packages"; /** * The property name of multiple properties binding from externalized configuration *

* The default value is {@link #DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE} */ - public static final String MULTIPLE_CONFIG_PROPERTY_NAME = DUBBO_CONFIG_PREFIX + PROPERTY_NAME_SEPARATOR + "multiple"; + public static final String MULTIPLE_CONFIG_PROPERTY_NAME = "multiple"; /** * The default value of multiple properties binding from externalized configuration @@ -81,7 +81,7 @@ public abstract class DubboUtils { *

* The default value is {@link #DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE} */ - public static final String OVERRIDE_CONFIG_PROPERTY_NAME = DUBBO_CONFIG_PREFIX + PROPERTY_NAME_SEPARATOR + "override"; + public static final String OVERRIDE_CONFIG_PROPERTY_NAME = "override"; /** * The default property value of override Dubbo config @@ -129,7 +129,7 @@ public static SortedMap filterDubboProperties(ConfigurableEnviro for (Map.Entry entry : properties.entrySet()) { String propertyName = entry.getKey(); - if (propertyName.startsWith(DUBBO_PREFIX + PROPERTY_NAME_SEPARATOR)) { + if (propertyName.startsWith(DUBBO_PREFIX)) { dubboProperties.put(propertyName, entry.getValue()); } diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java index 40fd6bc3c..0a68a6b6f 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java @@ -39,7 +39,8 @@ /** * {@link DubboUtils} Test - *Ø + * Ø + * * @author Mercy * @see DubboUtils * @since 1.0.0 @@ -49,17 +50,17 @@ public class DubboUtilsTest { @Test public void testConstants() { - Assert.assertEquals("dubbo", DUBBO_PREFIX); + Assert.assertEquals("dubbo.", DUBBO_PREFIX); - Assert.assertEquals("dubbo.scan", DUBBO_SCAN_PREFIX); + Assert.assertEquals("dubbo.scan.", DUBBO_SCAN_PREFIX); - Assert.assertEquals("dubbo.scan.base-packages", BASE_PACKAGES_PROPERTY_NAME); + Assert.assertEquals("dubbo.scan.base-packages", DUBBO_SCAN_PREFIX + BASE_PACKAGES_PROPERTY_NAME); - Assert.assertEquals("dubbo.config", DUBBO_CONFIG_PREFIX); + Assert.assertEquals("dubbo.config.", DUBBO_CONFIG_PREFIX); - Assert.assertEquals("dubbo.config.multiple", MULTIPLE_CONFIG_PROPERTY_NAME); + Assert.assertEquals("dubbo.config.multiple", DUBBO_CONFIG_PREFIX + MULTIPLE_CONFIG_PROPERTY_NAME); - Assert.assertEquals("dubbo.config.override", OVERRIDE_CONFIG_PROPERTY_NAME); + Assert.assertEquals("dubbo.config.override", DUBBO_CONFIG_PREFIX + OVERRIDE_CONFIG_PROPERTY_NAME); Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project", DUBBO_SPRING_BOOT_GITHUB_URL); Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project.git", DUBBO_SPRING_BOOT_GIT_URL); @@ -81,13 +82,13 @@ public void testFilterDubboProperties() { MockEnvironment environment = new MockEnvironment(); environment.setProperty("message", "Hello,World"); - environment.setProperty(MULTIPLE_CONFIG_PROPERTY_NAME, "true"); - environment.setProperty(OVERRIDE_CONFIG_PROPERTY_NAME, "true"); + environment.setProperty(DUBBO_CONFIG_PREFIX + MULTIPLE_CONFIG_PROPERTY_NAME, "true"); + environment.setProperty(DUBBO_CONFIG_PREFIX + OVERRIDE_CONFIG_PROPERTY_NAME, "true"); SortedMap dubboProperties = filterDubboProperties(environment); - Assert.assertEquals("true",dubboProperties.get(MULTIPLE_CONFIG_PROPERTY_NAME)); - Assert.assertEquals("true",dubboProperties.get(OVERRIDE_CONFIG_PROPERTY_NAME)); + Assert.assertEquals("true", dubboProperties.get(DUBBO_CONFIG_PREFIX + MULTIPLE_CONFIG_PROPERTY_NAME)); + Assert.assertEquals("true", dubboProperties.get(DUBBO_CONFIG_PREFIX + OVERRIDE_CONFIG_PROPERTY_NAME)); } From 4d796b0971c89def68a57e7193ef7eb3b13e96ec Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Fri, 21 Dec 2018 11:00:29 +0800 Subject: [PATCH 15/18] Optimize Awaiting implementation --- .../AwaitingNonWebApplicationListener.java | 112 +++++++++++++----- 1 file changed, 84 insertions(+), 28 deletions(-) diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListener.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListener.java index a2b8b3f13..1ab49cc40 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListener.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListener.java @@ -20,11 +20,18 @@ import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ContextClosedEvent; +import org.springframework.context.event.SmartApplicationListener; +import org.springframework.util.ObjectUtils; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; /** * Awaiting Non-Web Spring Boot {@link ApplicationListener} @@ -32,18 +39,46 @@ * @author Mercy * @since 0.1.1 */ -public class AwaitingNonWebApplicationListener implements ApplicationListener { +public class AwaitingNonWebApplicationListener implements SmartApplicationListener { private static final Logger logger = LoggerFactory.getLogger(AwaitingNonWebApplicationListener.class); - private static final ExecutorService executorService = Executors.newSingleThreadExecutor(); + private static final Class[] SUPPORTED_APPLICATION_EVENTS = + of(ApplicationReadyEvent.class, ContextClosedEvent.class); - private static final AtomicBoolean shutdownHookRegistered = new AtomicBoolean(false); + private static final ExecutorService executorService = Executors.newSingleThreadExecutor(); private static final AtomicBoolean awaited = new AtomicBoolean(false); + private final Lock lock = new ReentrantLock(); + + private final Condition condition = lock.newCondition(); + @Override - public void onApplicationEvent(ApplicationReadyEvent event) { + public boolean supportsEventType(Class eventType) { + return ObjectUtils.containsElement(SUPPORTED_APPLICATION_EVENTS, eventType); + } + + @Override + public boolean supportsSourceType(Class sourceType) { + return true; + } + + @Override + public void onApplicationEvent(ApplicationEvent event) { + if (event instanceof ApplicationReadyEvent) { + onApplicationReadyEvent((ApplicationReadyEvent) event); + } else if (event instanceof ContextClosedEvent) { + onContextClosedEvent((ContextClosedEvent) event); + } + } + + @Override + public int getOrder() { + return LOWEST_PRECEDENCE; + } + + protected void onApplicationReadyEvent(ApplicationReadyEvent event) { final SpringApplication springApplication = event.getSpringApplication(); @@ -51,46 +86,67 @@ public void onApplicationEvent(ApplicationReadyEvent event) { return; } + // has been waited, return immediately + if (awaited.get()) { + return; + } + executorService.execute(new Runnable() { @Override public void run() { + await(); + } + }); + } - synchronized (springApplication) { + protected void onContextClosedEvent(ContextClosedEvent event) { + release(); + } + + protected void await() { + executeMutually(new Runnable() { + @Override + public void run() { + while (!awaited.get()) { if (logger.isInfoEnabled()) { logger.info(" [Dubbo] Current Spring Boot Application is await..."); } - while (!awaited.get()) { - try { - springApplication.wait(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } + try { + condition.await(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); } } } }); + } - // register ShutdownHook - if (shutdownHookRegistered.compareAndSet(false, true)) { - registerShutdownHook(new Thread(new Runnable() { - @Override - public void run() { - synchronized (springApplication) { - if (awaited.compareAndSet(false, true)) { - springApplication.notifyAll(); - if (logger.isInfoEnabled()) { - logger.info(" [Dubbo] Current Spring Boot Application is about to shutdown..."); - } - // Shutdown executorService - executorService.shutdown(); - } + protected void release() { + executeMutually(new Runnable() { + @Override + public void run() { + while (awaited.compareAndSet(false, true)) { + if (logger.isInfoEnabled()) { + logger.info(" [Dubbo] Current Spring Boot Application is about to shutdown..."); } + condition.signalAll(); + // Shutdown executorService + executorService.shutdown(); } - })); + } + }); + } + + private void executeMutually(Runnable runnable) { + try { + lock.lock(); + runnable.run(); + } finally { + lock.unlock(); } } - private void registerShutdownHook(Thread thread) { - Runtime.getRuntime().addShutdownHook(thread); + private static T[] of(T... values) { + return values; } } From 90b8687a846d49f733249b8501cbfc1f5c6098d3 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Fri, 21 Dec 2018 11:08:29 +0800 Subject: [PATCH 16/18] Remove author from JavaDoc --- .../DubboEndpointAutoConfiguration.java | 2 +- ...DubboHealthIndicatorAutoConfiguration.java | 3 +- ...ndpointManagementContextConfiguration.java | 2 +- .../dubbo/actuate/endpoint/DubboEndpoint.java | 9 +++- .../endpoint/mvc/DubboMvcEndpoint.java | 2 +- .../actuate/health/DubboHealthIndicator.java | 3 +- .../DubboHealthIndicatorProperties.java | 2 +- .../actuate/endpoint/DubboEndpointTest.java | 3 +- .../endpoint/mvc/DubboMvcEndpointTest.java | 2 +- .../health/DubboHealthIndicatorTest.java | 3 +- .../autoconfigure/DubboAutoConfiguration.java | 43 +++++++++---------- .../RelaxedDubboConfigBinder.java | 1 - .../AwaitingNonWebApplicationListener.java | 9 ++-- ...verrideDubboConfigApplicationListener.java | 1 - .../event/WelcomeLogoApplicationListener.java | 1 - .../alibaba/boot/dubbo/util/DubboUtils.java | 1 - .../boot/dubbo/util/EnvironmentUtils.java | 8 +++- ...AutoConfigurationOnMultipleConfigTest.java | 1 - ...boAutoConfigurationOnSingleConfigTest.java | 10 ++++- .../RelaxedDubboConfigBinderTest.java | 2 +- ...oConfigApplicationListenerDisableTest.java | 2 +- ...ideDubboConfigApplicationListenerTest.java | 8 ++-- .../WelcomeLogoApplicationListenerTest.java | 1 - .../boot/dubbo/util/DubboUtilsTest.java | 2 +- .../boot/dubbo/util/EnvironmentUtilsTest.java | 1 - .../boot/dubbo/demo/consumer/DemoService.java | 1 - .../consumer/bootstrap/DubboConsumerDemo.java | 1 - .../controller/DemoConsumerController.java | 1 - .../provider/bootstrap/DubboProviderDemo.java | 1 - .../provider/service/DefaultDemoService.java | 1 - 30 files changed, 66 insertions(+), 61 deletions(-) diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboEndpointAutoConfiguration.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboEndpointAutoConfiguration.java index b7e6274dc..1f1e8f903 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboEndpointAutoConfiguration.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboEndpointAutoConfiguration.java @@ -29,7 +29,7 @@ /** * Dubbo {@link Endpoint} Auto Configuration * - * @author Mercy + * @see DubboEndpoint * @since 1.0.0 */ diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboHealthIndicatorAutoConfiguration.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboHealthIndicatorAutoConfiguration.java index 8dc9892a2..0780baafb 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboHealthIndicatorAutoConfiguration.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboHealthIndicatorAutoConfiguration.java @@ -19,6 +19,7 @@ import com.alibaba.boot.dubbo.actuate.health.DubboHealthIndicator; import com.alibaba.boot.dubbo.actuate.health.DubboHealthIndicatorProperties; import com.alibaba.boot.dubbo.autoconfigure.DubboAutoConfiguration; + import org.springframework.boot.actuate.autoconfigure.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration; import org.springframework.boot.actuate.health.HealthIndicator; @@ -33,7 +34,7 @@ /** * Dubbo {@link DubboHealthIndicator} Auto Configuration * - * @author Mercy + * @see HealthIndicator * @since 1.0.0 */ diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java index 2a079e9ec..1cc098462 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java @@ -32,7 +32,7 @@ /** * Dubbo {@link MvcEndpoint} {@link ManagementContextConfiguration} * - * @author Mercy + * @see ManagementContextConfiguration * @since 1.0.0 */ diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java index 4b3199ec4..b4b56de07 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java @@ -18,6 +18,7 @@ import com.alibaba.boot.dubbo.util.DubboUtils; import com.alibaba.dubbo.common.Version; + import org.springframework.boot.actuate.endpoint.AbstractEndpoint; import org.springframework.boot.actuate.endpoint.Endpoint; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -25,12 +26,16 @@ import java.util.LinkedHashMap; import java.util.Map; -import static com.alibaba.boot.dubbo.util.DubboUtils.*; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_GITHUB_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_MAILING_LIST; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SPRING_BOOT_GITHUB_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SPRING_BOOT_GIT_URL; +import static com.alibaba.boot.dubbo.util.DubboUtils.DUBBO_SPRING_BOOT_ISSUES_URL; /** * Actuator {@link Endpoint} to expose Dubbo Meta Data * - * @author Mercy + * @see Endpoint * @since 1.0.0 */ diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpoint.java index 641452a1e..529234d0a 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpoint.java @@ -83,7 +83,7 @@ /** * {@link MvcEndpoint} to expose Dubbo Metadata * - * @author Mercy + * @see MvcEndpoint * @since 1.0.0 */ diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicator.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicator.java index 4de90222f..25a1ff8b1 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicator.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicator.java @@ -20,6 +20,7 @@ import com.alibaba.dubbo.common.status.StatusChecker; import com.alibaba.dubbo.config.ProtocolConfig; import com.alibaba.dubbo.config.ProviderConfig; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.actuate.health.AbstractHealthIndicator; import org.springframework.boot.actuate.health.Health; @@ -37,7 +38,7 @@ /** * Dubbo {@link HealthIndicator} * - * @author Mercy + * @see HealthIndicator * @since 1.0.0 */ diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicatorProperties.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicatorProperties.java index 2ba7da2db..9da87e72a 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicatorProperties.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicatorProperties.java @@ -30,7 +30,7 @@ /** * Dubbo {@link HealthIndicator} Properties * - * @author Mercy + * @see HealthIndicator * @since 1.0.0 */ diff --git a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointTest.java b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointTest.java index 1c5e4cf7f..9f05e04ac 100644 --- a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointTest.java +++ b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointTest.java @@ -17,6 +17,7 @@ package com.alibaba.boot.dubbo.actuate.endpoint; import com.alibaba.boot.dubbo.util.DubboUtils; + import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -31,7 +32,7 @@ /** * {@link DubboEndpoint} Test * - * @author Mercy + * @see DubboEndpoint * @since 1.0.0 */ diff --git a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java index e8e9c38cb..abce2feb8 100644 --- a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java +++ b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/mvc/DubboMvcEndpointTest.java @@ -36,7 +36,7 @@ /** * {@link DubboMvcEndpoint} Test * - * @author Mercy + * @see DubboMvcEndpoint * @since 1.0.0 */ diff --git a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicatorTest.java b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicatorTest.java index 6d736f01b..10da6e9ac 100644 --- a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicatorTest.java +++ b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/health/DubboHealthIndicatorTest.java @@ -17,6 +17,7 @@ package com.alibaba.boot.dubbo.actuate.health; import com.alibaba.dubbo.config.spring.context.annotation.EnableDubboConfig; + import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -33,7 +34,7 @@ /** * {@link DubboHealthIndicator} Test * - * @author Mercy + * @see DubboHealthIndicator * @since 1.0.0 */ diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java index 781900c33..9533eed44 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java @@ -50,7 +50,6 @@ /** * Dubbo Auto {@link Configuration} * - * @author Mercy * @see ApplicationConfig * @see Service * @see Reference @@ -64,27 +63,6 @@ @ConditionalOnClass(AbstractConfig.class) public class DubboAutoConfiguration { - /** - * Single Dubbo Config Configuration - * - * @see EnableDubboConfig - * @see DubboConfigConfiguration.Single - */ - @EnableDubboConfig - protected static class SingleDubboConfigConfiguration { - } - - /** - * Multiple Dubbo Config Configuration , equals @EnableDubboConfig.multiple() == true - * - * @see EnableDubboConfig - * @see DubboConfigConfiguration.Multiple - */ - @ConditionalOnProperty(prefix = DUBBO_CONFIG_PREFIX, name = MULTIPLE_CONFIG_PROPERTY_NAME, havingValue = "true") - @EnableDubboConfig(multiple = true) - protected static class MultipleDubboConfigConfiguration { - } - /** * Creates {@link ServiceAnnotationBeanPostProcessor} Bean * @@ -118,4 +96,25 @@ public ReferenceAnnotationBeanPostProcessor referenceAnnotationBeanPostProcessor return new ReferenceAnnotationBeanPostProcessor(); } + /** + * Single Dubbo Config Configuration + * + * @see EnableDubboConfig + * @see DubboConfigConfiguration.Single + */ + @EnableDubboConfig + protected static class SingleDubboConfigConfiguration { + } + + /** + * Multiple Dubbo Config Configuration , equals @EnableDubboConfig.multiple() == true + * + * @see EnableDubboConfig + * @see DubboConfigConfiguration.Multiple + */ + @ConditionalOnProperty(prefix = DUBBO_CONFIG_PREFIX, name = MULTIPLE_CONFIG_PROPERTY_NAME, havingValue = "true") + @EnableDubboConfig(multiple = true) + protected static class MultipleDubboConfigConfiguration { + } + } diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/RelaxedDubboConfigBinder.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/RelaxedDubboConfigBinder.java index b72b23465..ddfd0afa3 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/RelaxedDubboConfigBinder.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/RelaxedDubboConfigBinder.java @@ -30,7 +30,6 @@ /** * Spring Boot Relaxed {@link DubboConfigBinder} implementation * - * @author Mercy * @since 0.1.1 */ public class RelaxedDubboConfigBinder extends AbstractDubboConfigBinder { diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListener.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListener.java index 1ab49cc40..5b31708c1 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListener.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListener.java @@ -36,7 +36,6 @@ /** * Awaiting Non-Web Spring Boot {@link ApplicationListener} * - * @author Mercy * @since 0.1.1 */ public class AwaitingNonWebApplicationListener implements SmartApplicationListener { @@ -54,6 +53,10 @@ public class AwaitingNonWebApplicationListener implements SmartApplicationListen private final Condition condition = lock.newCondition(); + private static T[] of(T... values) { + return values; + } + @Override public boolean supportsEventType(Class eventType) { return ObjectUtils.containsElement(SUPPORTED_APPLICATION_EVENTS, eventType); @@ -145,8 +148,4 @@ private void executeMutually(Runnable runnable) { lock.unlock(); } } - - private static T[] of(T... values) { - return values; - } } diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListener.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListener.java index 283081b06..241b9175a 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListener.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListener.java @@ -39,7 +39,6 @@ * {@link ConfigUtils#getProperties() Dubbo Config}. * {@link AbstractConfig Dubbo Config} on {@link ApplicationEnvironmentPreparedEvent}. * - * @author Mercy * @see ConfigUtils * @since 1.0.0 */ diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java index de4d8c228..ca8d6fd24 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListener.java @@ -33,7 +33,6 @@ /** * Dubbo Welcome Logo {@link ApplicationListener} * - * @author Mercy * @see ApplicationListener * @since 1.0.0 */ diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java index 1c38c0d8a..27aca5915 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java @@ -26,7 +26,6 @@ /** * The utilities class for Dubbo * - * @author Mercy * @since 1.0.0 */ public abstract class DubboUtils { diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/EnvironmentUtils.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/EnvironmentUtils.java index 910c113a6..07886715b 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/EnvironmentUtils.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/EnvironmentUtils.java @@ -16,7 +16,12 @@ */ package com.alibaba.boot.dubbo.util; -import org.springframework.core.env.*; +import org.springframework.core.env.CompositePropertySource; +import org.springframework.core.env.ConfigurableEnvironment; +import org.springframework.core.env.EnumerablePropertySource; +import org.springframework.core.env.Environment; +import org.springframework.core.env.MutablePropertySources; +import org.springframework.core.env.PropertySource; import org.springframework.util.ObjectUtils; import java.util.Collections; @@ -26,7 +31,6 @@ /** * The utilities class for {@link Environment} * - * @author Mercy * @see Environment * @since 1.0.0 */ diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java index 938f29988..8360d7fdb 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java @@ -43,7 +43,6 @@ /** * {@link DubboAutoConfiguration} Test On multiple Dubbo Configuration * - * @author Mercy * @since 1.0.0 */ @RunWith(SpringJUnit4ClassRunner.class) diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfigurationOnSingleConfigTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfigurationOnSingleConfigTest.java index c8092d3f6..013adec9e 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfigurationOnSingleConfigTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfigurationOnSingleConfigTest.java @@ -16,9 +16,16 @@ */ package com.alibaba.boot.dubbo.autoconfigure; -import com.alibaba.dubbo.config.*; +import com.alibaba.dubbo.config.ApplicationConfig; +import com.alibaba.dubbo.config.ConsumerConfig; +import com.alibaba.dubbo.config.ModuleConfig; +import com.alibaba.dubbo.config.MonitorConfig; +import com.alibaba.dubbo.config.ProtocolConfig; +import com.alibaba.dubbo.config.ProviderConfig; +import com.alibaba.dubbo.config.RegistryConfig; import com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor; import com.alibaba.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor; + import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,7 +39,6 @@ /** * {@link DubboAutoConfiguration} Test On single Dubbo Configuration * - * @author Mercy * @since 1.0.0 */ @RunWith(SpringJUnit4ClassRunner.class) diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/RelaxedDubboConfigBinderTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/RelaxedDubboConfigBinderTest.java index 8e080861c..ec478456a 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/RelaxedDubboConfigBinderTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/autoconfigure/RelaxedDubboConfigBinderTest.java @@ -19,6 +19,7 @@ import com.alibaba.dubbo.config.ApplicationConfig; import com.alibaba.dubbo.config.ProtocolConfig; import com.alibaba.dubbo.config.RegistryConfig; + import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -30,7 +31,6 @@ /** * {@link RelaxedDubboConfigBinder} Test * - * @author Mercy * @since 0.1.1 */ @RunWith(SpringJUnit4ClassRunner.class) diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListenerDisableTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListenerDisableTest.java index c425b8312..8c7cbd775 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListenerDisableTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListenerDisableTest.java @@ -17,6 +17,7 @@ package com.alibaba.boot.dubbo.context.event; import com.alibaba.dubbo.common.utils.ConfigUtils; + import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; @@ -30,7 +31,6 @@ /** * {@link OverrideDubboConfigApplicationListener} Test * - * @author Mercy * @see OverrideDubboConfigApplicationListener * @since 1.0.0 */ diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListenerTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListenerTest.java index c7d98d0f7..8be40ac9f 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListenerTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/OverrideDubboConfigApplicationListenerTest.java @@ -17,6 +17,7 @@ package com.alibaba.boot.dubbo.context.event; import com.alibaba.dubbo.common.utils.ConfigUtils; + import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; @@ -30,7 +31,6 @@ /** * {@link OverrideDubboConfigApplicationListener} Test * - * @author Mercy * @see OverrideDubboConfigApplicationListener * @since 1.0.0 */ @@ -57,9 +57,9 @@ public void testOnApplicationEvent() { Properties properties = ConfigUtils.getProperties(); - Assert.assertEquals("dubbo-demo-application",properties.get("dubbo.application.name")); - Assert.assertEquals("dubbo-demo-module",properties.get("dubbo.module.name")); - Assert.assertEquals("zookeeper://192.168.99.100:32770",properties.get("dubbo.registry.address")); + Assert.assertEquals("dubbo-demo-application", properties.get("dubbo.application.name")); + Assert.assertEquals("dubbo-demo-module", properties.get("dubbo.module.name")); + Assert.assertEquals("zookeeper://192.168.99.100:32770", properties.get("dubbo.registry.address")); } diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListenerTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListenerTest.java index b603264d2..7d596124d 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListenerTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListenerTest.java @@ -26,7 +26,6 @@ /** * {@link WelcomeLogoApplicationListener} Test * - * @author Mercy * @see WelcomeLogoApplicationListener * @since 1.0.0 */ diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java index f00f23f2c..57ca64747 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/DubboUtilsTest.java @@ -39,7 +39,7 @@ /** * {@link DubboUtils} Test - * @author Mercy + * * @see DubboUtils * @since 1.0.0 */ diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/EnvironmentUtilsTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/EnvironmentUtilsTest.java index d22ba4983..52d3a1633 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/EnvironmentUtilsTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/util/EnvironmentUtilsTest.java @@ -29,7 +29,6 @@ /** * {@link EnvironmentUtils} Test * - * @author Mercy * @see EnvironmentUtils * @since 1.0.0 */ diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/src/main/java/com/alibaba/boot/dubbo/demo/consumer/DemoService.java b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/src/main/java/com/alibaba/boot/dubbo/demo/consumer/DemoService.java index 59bdfc165..bff13094f 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/src/main/java/com/alibaba/boot/dubbo/demo/consumer/DemoService.java +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/src/main/java/com/alibaba/boot/dubbo/demo/consumer/DemoService.java @@ -19,7 +19,6 @@ /** * Demo Service interface * - * @author Mercy * @since 1.0.0 */ public interface DemoService { diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboConsumerDemo.java b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboConsumerDemo.java index 7f10d51ea..12fb7b7b8 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboConsumerDemo.java +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboConsumerDemo.java @@ -24,7 +24,6 @@ /** * Dubbo Consumer Demo * - * @author Mercy * @see DemoConsumerController * @since 1.0.0 */ diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java index e1db35288..a2be8191a 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java @@ -26,7 +26,6 @@ /** * Demo Consumer Controller (REST) * - * @author Mercy * @see RestController * @since 1.0.0 */ diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboProviderDemo.java b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboProviderDemo.java index 70a99d7cc..18f6ba7b2 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboProviderDemo.java +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboProviderDemo.java @@ -24,7 +24,6 @@ /** * Dubbo Provider Demo * - * @author Mercy * @see DefaultDemoService * @since 1.0.0 */ diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index 01ff1c6a5..5a66ceabb 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -22,7 +22,6 @@ /** * Default {@link DemoService} * - * @author Mercy * @see DemoService * @since 1.0.0 */ From 5fec0adbce2b794bc943aa35c34a41e75b0ce253 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Sat, 22 Dec 2018 01:37:12 +0800 Subject: [PATCH 17/18] Refactor --- .../AwaitingNonWebApplicationListener.java | 60 +++++++++++-------- ...AwaitingNonWebApplicationListenerTest.java | 56 +++++++++++++++++ 2 files changed, 92 insertions(+), 24 deletions(-) create mode 100644 dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListenerTest.java diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListener.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListener.java index 5b31708c1..f7d20c512 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListener.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListener.java @@ -45,14 +45,14 @@ public class AwaitingNonWebApplicationListener implements SmartApplicationListen private static final Class[] SUPPORTED_APPLICATION_EVENTS = of(ApplicationReadyEvent.class, ContextClosedEvent.class); - private static final ExecutorService executorService = Executors.newSingleThreadExecutor(); - private static final AtomicBoolean awaited = new AtomicBoolean(false); private final Lock lock = new ReentrantLock(); private final Condition condition = lock.newCondition(); + private final ExecutorService executorService = Executors.newSingleThreadExecutor(); + private static T[] of(T... values) { return values; } @@ -89,37 +89,40 @@ protected void onApplicationReadyEvent(ApplicationReadyEvent event) { return; } - // has been waited, return immediately - if (awaited.get()) { - return; - } + await(); - executorService.execute(new Runnable() { - @Override - public void run() { - await(); - } - }); } protected void onContextClosedEvent(ContextClosedEvent event) { release(); + shutdown(); } protected void await() { - executeMutually(new Runnable() { + + // has been waited, return immediately + if (awaited.get()) { + return; + } + + executorService.execute(new Runnable() { @Override public void run() { - while (!awaited.get()) { - if (logger.isInfoEnabled()) { - logger.info(" [Dubbo] Current Spring Boot Application is await..."); - } - try { - condition.await(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); + executeMutually(new Runnable() { + @Override + public void run() { + while (!awaited.get()) { + if (logger.isInfoEnabled()) { + logger.info(" [Dubbo] Current Spring Boot Application is await..."); + } + try { + condition.await(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } } - } + }); } }); } @@ -133,13 +136,18 @@ public void run() { logger.info(" [Dubbo] Current Spring Boot Application is about to shutdown..."); } condition.signalAll(); - // Shutdown executorService - executorService.shutdown(); } } }); } + private void shutdown() { + if (!executorService.isShutdown()) { + // Shutdown executorService + executorService.shutdown(); + } + } + private void executeMutually(Runnable runnable) { try { lock.lock(); @@ -148,4 +156,8 @@ private void executeMutually(Runnable runnable) { lock.unlock(); } } + + static AtomicBoolean getAwaited() { + return awaited; + } } diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListenerTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListenerTest.java new file mode 100644 index 000000000..4f4bff30b --- /dev/null +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListenerTest.java @@ -0,0 +1,56 @@ +/* + * 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 com.alibaba.boot.dubbo.context.event; + +import org.junit.Assert; +import org.junit.Test; +import org.springframework.boot.builder.SpringApplicationBuilder; + +import java.util.concurrent.atomic.AtomicBoolean; + +/** + * {@link AwaitingNonWebApplicationListener} Test + */ +public class AwaitingNonWebApplicationListenerTest { + + @Test + public void init() { + AtomicBoolean awaited = AwaitingNonWebApplicationListener.getAwaited(); + awaited.set(false); + + } + + @Test + public void testSingleContextNonWebApplication() { + new SpringApplicationBuilder(Object.class) + .web(false) + .run().close(); + AtomicBoolean awaited = AwaitingNonWebApplicationListener.getAwaited(); + Assert.assertTrue(awaited.get()); + } + + @Test + public void testMultipleContextNonWebApplication() { + new SpringApplicationBuilder(Object.class) + .parent(Object.class) + .web(false) + .run().close(); + AtomicBoolean awaited = AwaitingNonWebApplicationListener.getAwaited(); + Assert.assertTrue(awaited.get()); + } + +} From 73ca6d6bf6ca165a1143fe1af260491cf2fe9676 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Thu, 27 Dec 2018 13:55:30 +0800 Subject: [PATCH 18/18] Merge --- .../autoconfigure/DubboAutoConfiguration.java | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java index 5d8a7d1fa..18577a812 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java @@ -116,26 +116,4 @@ public RelaxedDubboConfigBinder relaxedDubboConfigBinder() { public ReferenceAnnotationBeanPostProcessor referenceAnnotationBeanPostProcessor() { return new ReferenceAnnotationBeanPostProcessor(); } - - /** - * Single Dubbo Config Configuration - * - * @see EnableDubboConfig - * @see DubboConfigConfiguration.Single - */ - @EnableDubboConfig - protected static class SingleDubboConfigConfiguration { - } - - /** - * Multiple Dubbo Config Configuration , equals @EnableDubboConfig.multiple() == true - * - * @see EnableDubboConfig - * @see DubboConfigConfiguration.Multiple - */ - @ConditionalOnProperty(prefix = DUBBO_CONFIG_PREFIX, name = MULTIPLE_CONFIG_PROPERTY_NAME, havingValue = "true") - @EnableDubboConfig(multiple = true) - protected static class MultipleDubboConfigConfiguration { - } - }