From 1494a7787b41f14a57f8fcf2f6e18a7fd58a9cf1 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Sat, 9 Jun 2018 02:36:04 +0800 Subject: [PATCH 01/46] Fix apache/incubator-dubbo-spring-boot-project#169 --- .../alibaba/boot/dubbo/autoconfigure/DubboAutoConfiguration.java | 1 - 1 file changed, 1 deletion(-) 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 2f4bc4f44..1b86dce4c 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 @@ -65,7 +65,6 @@ public class DubboAutoConfiguration { * @see EnableDubboConfig * @see DubboConfigConfiguration.Single */ - @ConditionalOnProperty(name = MULTIPLE_CONFIG_PROPERTY_NAME, havingValue = "false", matchIfMissing = true) @EnableDubboConfig protected static class SingleDubboConfigConfiguration { } From 58e2c9142a08962bbc40771123aabf9e74b26db9 Mon Sep 17 00:00:00 2001 From: feichangxinfu <13710391097@163.com> Date: Tue, 30 Oct 2018 17:59:29 +0800 Subject: [PATCH 02/46] correct some wrongly written chinese characters in the README_CN.md --- README_CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_CN.md b/README_CN.md index a61660e96..e59a45c68 100644 --- a/README_CN.md +++ b/README_CN.md @@ -259,8 +259,8 @@ Dubbo Spring Boot 采用多 Maven 模块工程 , 模块如下: [dubbo-spring-boot-actuator](dubbo-spring-boot-actuator) 提供 Production-Ready 特性: * [健康检查](dubbo-spring-boot-actuator#health-checks) -* [控制断点](dubbo-spring-boot-actuator#endpoints) -* [外部化配置](dubbo-spring-boot-actuator#externalized-configuration)) +* [控制端点](dubbo-spring-boot-actuator#endpoints) +* [外部化配置](dubbo-spring-boot-actuator#externalized-configuration) ### [dubbo-spring-boot-starter](dubbo-spring-boot-starter) From d01cf26bede92b7b3ecdb1ad043a66160c820c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Thu, 27 Dec 2018 15:10:56 +0800 Subject: [PATCH 03/46] 0.2.1 (#345) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread --- .../DubboEndpointsAutoConfiguration.java | 10 +- ...DubboHealthIndicatorAutoConfiguration.java | 3 +- .../endpoint/AbstractDubboEndpoint.java | 3 +- .../DubboConfigsMetadataEndpoint.java | 2 +- .../dubbo/actuate/endpoint/DubboEndpoint.java | 2 +- .../endpoint/DubboPropertiesEndpoint.java | 2 +- .../DubboReferencesMetadataEndpoint.java | 2 +- .../DubboServicesMetadataEndpoint.java | 2 +- .../endpoint/DubboShutdownEndpoint.java | 2 +- .../actuate/health/DubboHealthIndicator.java | 3 +- .../DubboHealthIndicatorProperties.java | 2 +- .../actuate/endpoint/DubboEndpointTest.java | 2 +- .../DubboEndpointsAutoConfigurationTest.java | 2 +- .../health/DubboHealthIndicatorTest.java | 3 +- .../autoconfigure/DubboAutoConfiguration.java | 48 ++++--- .../RelaxedDubboConfigBinder.java | 1 - .../AwaitingNonWebApplicationListener.java | 136 ++++++++++++------ ...verrideDubboConfigApplicationListener.java | 6 +- .../event/WelcomeLogoApplicationListener.java | 1 - .../alibaba/boot/dubbo/util/DubboUtils.java | 3 +- .../boot/dubbo/util/EnvironmentUtils.java | 8 +- ...AutoConfigurationOnMultipleConfigTest.java | 11 +- ...boAutoConfigurationOnSingleConfigTest.java | 11 +- .../RelaxedDubboConfigBinderTest.java | 3 +- ...AwaitingNonWebApplicationListenerTest.java | 57 ++++++++ ...oConfigApplicationListenerDisableTest.java | 3 +- ...ideDubboConfigApplicationListenerTest.java | 3 +- .../WelcomeLogoApplicationListenerTest.java | 2 +- .../boot/dubbo/util/DubboUtilsTest.java | 2 +- .../boot/dubbo/util/EnvironmentUtilsTest.java | 2 +- 30 files changed, 240 insertions(+), 97 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-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboEndpointsAutoConfiguration.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboEndpointsAutoConfiguration.java index 038e0bf51..efa5b4153 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboEndpointsAutoConfiguration.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/autoconfigure/DubboEndpointsAutoConfiguration.java @@ -16,7 +16,13 @@ */ package com.alibaba.boot.dubbo.actuate.autoconfigure; -import com.alibaba.boot.dubbo.actuate.endpoint.*; +import com.alibaba.boot.dubbo.actuate.endpoint.DubboConfigsMetadataEndpoint; +import com.alibaba.boot.dubbo.actuate.endpoint.DubboEndpoint; +import com.alibaba.boot.dubbo.actuate.endpoint.DubboPropertiesEndpoint; +import com.alibaba.boot.dubbo.actuate.endpoint.DubboReferencesMetadataEndpoint; +import com.alibaba.boot.dubbo.actuate.endpoint.DubboServicesMetadataEndpoint; +import com.alibaba.boot.dubbo.actuate.endpoint.DubboShutdownEndpoint; + import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnEnabledEndpoint; import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -27,7 +33,7 @@ /** * Dubbo {@link Endpoint} Auto-{@link Configuration} * - * @author Mercy + * * @see Endpoint * @see Configuration * @since 0.2.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 c53c958df..20d2cf1ff 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.endpoint.EndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; 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/endpoint/AbstractDubboEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/AbstractDubboEndpoint.java index 95b865589..45a0cba56 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/AbstractDubboEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/AbstractDubboEndpoint.java @@ -19,6 +19,7 @@ import com.alibaba.dubbo.config.ProtocolConfig; import com.alibaba.dubbo.config.spring.ServiceBean; import com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor; + import org.springframework.beans.BeansException; import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.context.ApplicationContext; @@ -45,7 +46,7 @@ /** * Abstract Dubbo {@link Endpoint @Endpoint} * - * @author Mercy + * * @since 0.2.0 */ public abstract class AbstractDubboEndpoint implements ApplicationContextAware, EnvironmentAware { diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboConfigsMetadataEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboConfigsMetadataEndpoint.java index 3bdccb33a..4cdcc2e33 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboConfigsMetadataEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboConfigsMetadataEndpoint.java @@ -40,7 +40,7 @@ /** * Dubbo Configs Metadata {@link Endpoint} * - * @author Mercy + * * @since 0.2.0 */ @Endpoint(id = "dubboConfigs") 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 792374613..eba7b5666 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 @@ -34,7 +34,7 @@ /** * 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/DubboPropertiesEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboPropertiesEndpoint.java index 23fad4e8c..be302b6ad 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboPropertiesEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboPropertiesEndpoint.java @@ -26,7 +26,7 @@ /** * Dubbo Properties {@link Endpoint} * - * @author Mercy + * * @since 1.0.0 */ @Endpoint(id = "dubboProperties") diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboReferencesMetadataEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboReferencesMetadataEndpoint.java index 8a712c6f1..29da19bef 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboReferencesMetadataEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboReferencesMetadataEndpoint.java @@ -30,7 +30,7 @@ /** * Dubbo {@link Reference} Metadata {@link Endpoint} * - * @author Mercy + * * @since 1.0.0 */ @Endpoint(id = "dubboReferences") diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboServicesMetadataEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboServicesMetadataEndpoint.java index 3b1c5cb52..46582392e 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboServicesMetadataEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboServicesMetadataEndpoint.java @@ -28,7 +28,7 @@ /** * Dubbo {@link Service} Metadata {@link Endpoint} * - * @author Mercy + * * @since 0.2.0 */ @Endpoint(id = "dubboServices") diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboShutdownEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboShutdownEndpoint.java index 6c6e26a8c..151663f3f 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboShutdownEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboShutdownEndpoint.java @@ -32,7 +32,7 @@ /** * Dubbo Shutdown * - * @author Mercy + * * @since 0.2.0 */ @Endpoint(id = "dubboShutdown") 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..e84a24e98 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..e6db92811 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 e1aa531f0..ac2b04936 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 @@ -32,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/DubboEndpointsAutoConfigurationTest.java b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java index 3576dbafe..d01e67cdf 100644 --- a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java +++ b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java @@ -33,7 +33,7 @@ /** * {@link DubboEndpointsAutoConfiguration} Test * - * @author Mercy + * * @since 0.2.0 */ @RunWith(SpringRunner.class) 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..41de0a8e1 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 486c1b917..58029f446 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,14 +39,15 @@ 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; /** * Dubbo Auto {@link Configuration} * - * @author Mercy * @see ApplicationConfig * @see Service * @see Reference @@ -59,27 +61,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(name = MULTIPLE_CONFIG_PROPERTY_NAME, havingValue = "true") - @EnableDubboConfig(multiple = true) - protected static class MultipleDubboConfigConfiguration { - } - /** * Creates {@link ServiceAnnotationBeanPostProcessor} Bean * @@ -112,4 +93,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(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 51a6ab72f..72a66e7c1 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 @@ -36,7 +36,6 @@ * Spring Boot Relaxed {@link DubboConfigBinder} implementation * see org.springframework.boot.context.properties.ConfigurationPropertiesBinder * - * @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 55c3daa0b..b8a22348e 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 @@ -21,30 +21,68 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.WebApplicationType; 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} * - * @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 AtomicBoolean shutdownHookRegistered = new AtomicBoolean(false); + private static final Class[] SUPPORTED_APPLICATION_EVENTS = + of(ApplicationReadyEvent.class, ContextClosedEvent.class); 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(); + + @Override + public boolean supportsEventType(Class eventType) { + return ObjectUtils.containsElement(SUPPORTED_APPLICATION_EVENTS, eventType); + } + @Override - public void onApplicationEvent(ApplicationReadyEvent event) { + public boolean supportsSourceType(Class sourceType) { + return true; + } + + private static T[] of(T... values) { + return values; + } + + @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(); @@ -52,46 +90,64 @@ public void onApplicationEvent(ApplicationReadyEvent event) { return; } - executorService.execute(new Runnable() { - @Override - public void run() { - - synchronized (springApplication) { - if (logger.isInfoEnabled()) { - logger.info(" [Dubbo] Current Spring Boot Application is await..."); - } - while (!awaited.get()) { - try { - springApplication.wait(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } + await(); + + } + + protected void onContextClosedEvent(ContextClosedEvent event) { + release(); + shutdown(); + } + + protected void await() { + + // has been waited, return immediately + if (awaited.get()) { + return; + } + + executorService.execute(() -> executeMutually(() -> { + while (!awaited.get()) { + if (logger.isInfoEnabled()) { + logger.info(" [Dubbo] Current Spring Boot Application is await..."); + } + 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(() -> { + while (awaited.compareAndSet(false, true)) { + if (logger.isInfoEnabled()) { + logger.info(" [Dubbo] Current Spring Boot Application is about to shutdown..."); } - })); + condition.signalAll(); + } + }); + } + + private void shutdown() { + if (!executorService.isShutdown()) { + // 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); + static AtomicBoolean getAwaited() { + return awaited; } } 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 33ac29b3c..e2a236318 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 @@ -18,6 +18,7 @@ import com.alibaba.dubbo.common.utils.ConfigUtils; import com.alibaba.dubbo.config.AbstractConfig; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; @@ -28,7 +29,9 @@ 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 @@ -36,7 +39,6 @@ * {@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 99cf9808a..9802a3b96 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 @@ -35,7 +35,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 7bf2b6966..76ee68963 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 { @@ -130,7 +129,7 @@ public static SortedMap filterDubboProperties(ConfigurableEnviro String propertyName = entry.getKey(); if (propertyName.startsWith(DUBBO_PREFIX + PROPERTY_NAME_SEPARATOR) - && entry.getValue() != null) { + && entry.getValue() != null) { dubboProperties.put(propertyName, entry.getValue().toString()); } 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 9349d8129..9b20c58f8 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 ee9350938..af38587b8 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,10 +16,15 @@ */ 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.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -38,7 +43,7 @@ /** * {@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..b60340e75 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,7 @@ /** * {@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..0a151bab8 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,7 @@ /** * {@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/AwaitingNonWebApplicationListenerTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListenerTest.java new file mode 100644 index 000000000..42710cd31 --- /dev/null +++ b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/AwaitingNonWebApplicationListenerTest.java @@ -0,0 +1,57 @@ +/* + * 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.WebApplicationType; +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(WebApplicationType.NONE) + .run().close(); + AtomicBoolean awaited = AwaitingNonWebApplicationListener.getAwaited(); + Assert.assertTrue(awaited.get()); + } + + @Test + public void testMultipleContextNonWebApplication() { + new SpringApplicationBuilder(Object.class) + .parent(Object.class) + .web(WebApplicationType.NONE) + .run().close(); + AtomicBoolean awaited = AwaitingNonWebApplicationListener.getAwaited(); + Assert.assertTrue(awaited.get()); + } + +} 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..c69e5f513 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,7 @@ /** * {@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..2fd7cd15f 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,7 @@ /** * {@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/WelcomeLogoApplicationListenerTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/com/alibaba/boot/dubbo/context/event/WelcomeLogoApplicationListenerTest.java index b603264d2..34bb97196 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,7 @@ /** * {@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 af961134e..066cce5a2 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 @@ -40,7 +40,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..9155471a3 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,7 @@ /** * {@link EnvironmentUtils} Test * - * @author Mercy + * * @see EnvironmentUtils * @since 1.0.0 */ From 7021e60b47d437ade61e2a6605cd3dc62685412e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Thu, 27 Dec 2018 17:12:10 +0800 Subject: [PATCH 04/46] 0.2.1 (#346) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 --- dubbo-spring-boot-actuator/README.md | 12 ++-- dubbo-spring-boot-actuator/pom.xml | 9 --- .../DubboConfigsMetadataEndpoint.java | 2 +- .../endpoint/DubboPropertiesEndpoint.java | 2 +- .../DubboReferencesMetadataEndpoint.java | 2 +- .../DubboServicesMetadataEndpoint.java | 2 +- .../endpoint/DubboShutdownEndpoint.java | 3 +- .../dubbo-endpoins-default.properties | 21 +++---- .../DubboEndpointsAutoConfigurationTest.java | 61 +++++++++++++------ 9 files changed, 65 insertions(+), 49 deletions(-) diff --git a/dubbo-spring-boot-actuator/README.md b/dubbo-spring-boot-actuator/README.md index 401729256..1410bca39 100644 --- a/dubbo-spring-boot-actuator/README.md +++ b/dubbo-spring-boot-actuator/README.md @@ -23,7 +23,7 @@ For now, `dubbo-spring-boot-actuator` will separate two versions for Spring Boot * `0.1.x` is a legacy version for maintaining Spring Boot 1.x - ​ + ## Integrate with Maven @@ -503,10 +503,10 @@ Dubbo Spring Boot providers actuator endpoints , however some of them are disabl ```properties # Enables Dubbo All Endpoints management.endpoint.dubbo.enabled = true -management.endpoint.dubboShutdown.enabled = true -management.endpoint.dubboConfigs.enabled = true -management.endpoint.dubboServices.enabled = true -management.endpoint.dubboReferences.enabled = true -management.endpoint.dubboProperties.enabled = true +management.endpoint.dubboshutdown.enabled = true +management.endpoint.dubboconfigs.enabled = true +management.endpoint.dubboservices.enabled = true +management.endpoint.dubboreferences.enabled = true +management.endpoint.dubboproperties.enabled = true ``` diff --git a/dubbo-spring-boot-actuator/pom.xml b/dubbo-spring-boot-actuator/pom.xml index 70e8f2011..4e41bf245 100644 --- a/dubbo-spring-boot-actuator/pom.xml +++ b/dubbo-spring-boot-actuator/pom.xml @@ -32,15 +32,6 @@ - - - javax.servlet - javax.servlet-api - 3.1.0 - provided - true - - org.springframework.boot spring-boot-starter-web diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboConfigsMetadataEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboConfigsMetadataEndpoint.java index 4cdcc2e33..28b276a1e 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboConfigsMetadataEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboConfigsMetadataEndpoint.java @@ -43,7 +43,7 @@ * * @since 0.2.0 */ -@Endpoint(id = "dubboConfigs") +@Endpoint(id = "dubboconfigs") public class DubboConfigsMetadataEndpoint extends AbstractDubboEndpoint { @ReadOperation diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboPropertiesEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboPropertiesEndpoint.java index be302b6ad..f9b9d1a55 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboPropertiesEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboPropertiesEndpoint.java @@ -29,7 +29,7 @@ * * @since 1.0.0 */ -@Endpoint(id = "dubboProperties") +@Endpoint(id = "dubboproperties") public class DubboPropertiesEndpoint extends AbstractDubboEndpoint { @ReadOperation diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboReferencesMetadataEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboReferencesMetadataEndpoint.java index 29da19bef..3d4bbf6ed 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboReferencesMetadataEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboReferencesMetadataEndpoint.java @@ -33,7 +33,7 @@ * * @since 1.0.0 */ -@Endpoint(id = "dubboReferences") +@Endpoint(id = "dubboreferences") public class DubboReferencesMetadataEndpoint extends AbstractDubboEndpoint { @ReadOperation diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboServicesMetadataEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboServicesMetadataEndpoint.java index 46582392e..0c4c7886f 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboServicesMetadataEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboServicesMetadataEndpoint.java @@ -31,7 +31,7 @@ * * @since 0.2.0 */ -@Endpoint(id = "dubboServices") +@Endpoint(id = "dubboservices") public class DubboServicesMetadataEndpoint extends AbstractDubboEndpoint { @ReadOperation diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboShutdownEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboShutdownEndpoint.java index 151663f3f..10148003f 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboShutdownEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboShutdownEndpoint.java @@ -32,10 +32,9 @@ /** * Dubbo Shutdown * - * * @since 0.2.0 */ -@Endpoint(id = "dubboShutdown") +@Endpoint(id = "dubboshutdown") public class DubboShutdownEndpoint extends AbstractDubboEndpoint { diff --git a/dubbo-spring-boot-actuator/src/main/resources/META-INF/dubbo-endpoins-default.properties b/dubbo-spring-boot-actuator/src/main/resources/META-INF/dubbo-endpoins-default.properties index 99215bfcd..ffcf18814 100644 --- a/dubbo-spring-boot-actuator/src/main/resources/META-INF/dubbo-endpoins-default.properties +++ b/dubbo-spring-boot-actuator/src/main/resources/META-INF/dubbo-endpoins-default.properties @@ -4,19 +4,18 @@ # Set enabled for Dubbo Endpoints management.endpoint.dubbo.enabled = true -management.endpoint.dubboShutdown.enabled = false -management.endpoint.dubboConfigs.enabled = true -management.endpoint.dubboServices.enabled = false -management.endpoint.dubboReferences.enabled = false -management.endpoint.dubboProperties.enabled = true +management.endpoint.dubboshutdown.enabled = false +management.endpoint.dubboconfigs.enabled = true +management.endpoint.dubboservices.enabled = false +management.endpoint.dubboreferences.enabled = false +management.endpoint.dubboproperties.enabled = true # "management.endpoints.web.base-path" should not be configured in this file # Re-defines path-mapping of Dubbo Web Endpoints -management.endpoints.web.path-mapping.dubboShutdown = dubbo/shutdown -management.endpoints.web.path-mapping.dubboConfigs = dubbo/configs -management.endpoints.web.path-mapping.dubboServices = dubbo/services -management.endpoints.web.path-mapping.dubboReferences = dubbo/references -management.endpoints.web.path-mapping.dubboProperties = dubbo/properties - +management.endpoints.web.path-mapping.dubboshutdown = dubbo/shutdown +management.endpoints.web.path-mapping.dubboconfigs = dubbo/configs +management.endpoints.web.path-mapping.dubboservices = dubbo/services +management.endpoints.web.path-mapping.dubboreferences = dubbo/references +management.endpoints.web.path-mapping.dubboproperties = dubbo/properties \ No newline at end of file diff --git a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java index d01e67cdf..29e2af649 100644 --- a/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java +++ b/dubbo-spring-boot-actuator/src/test/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java @@ -19,21 +19,25 @@ import com.alibaba.boot.dubbo.actuate.autoconfigure.DubboEndpointsAutoConfiguration; import com.alibaba.dubbo.config.annotation.Service; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.client.RestTemplate; import java.util.Map; import java.util.SortedMap; +import java.util.function.Supplier; /** * {@link DubboEndpointsAutoConfiguration} Test * - * * @since 0.2.0 */ @RunWith(SpringRunner.class) @@ -58,11 +62,12 @@ "dubbo.provider.host=127.0.0.1", "dubbo.scan.basePackages=com.alibaba.boot.dubbo.actuate.endpoint", "management.endpoint.dubbo.enabled = true", - "management.endpoint.dubboShutdown.enabled = true", - "management.endpoint.dubboConfigs.enabled = true", - "management.endpoint.dubboServices.enabled = true", - "management.endpoint.dubboReferences.enabled = true", - "management.endpoint.dubboProperties.enabled = true", + "management.endpoint.dubboshutdown.enabled = true", + "management.endpoint.dubboconfigs.enabled = true", + "management.endpoint.dubboservices.enabled = true", + "management.endpoint.dubboreferences.enabled = true", + "management.endpoint.dubboproperties.enabled = true", + "management.endpoints.web.exposure.include = *", }) @EnableAutoConfiguration public class DubboEndpointsAutoConfigurationTest { @@ -85,6 +90,13 @@ public class DubboEndpointsAutoConfigurationTest { @Autowired private DubboShutdownEndpoint dubboShutdownEndpoint; + private RestTemplate restTemplate = new RestTemplate(); + + @Autowired + private ObjectMapper objectMapper; + + @Value("http://127.0.0.1:${local.management.port}${management.endpoints.web.base-path:/actuator}") + private String actuatorBaseURL; @Test public void testShutdown() throws Exception { @@ -178,20 +190,35 @@ public void testProperties() { Assert.assertEquals("com.alibaba.boot.dubbo.actuate.endpoint", properties.get("dubbo.scan.basePackages")); } + @Test + public void testHttpEndpoints() throws JsonProcessingException { +// testHttpEndpoint("/dubbo", dubboEndpoint::invoke); + testHttpEndpoint("/dubbo/configs", dubboConfigsMetadataEndpoint::configs); + testHttpEndpoint("/dubbo/services", dubboServicesMetadataEndpoint::services); + testHttpEndpoint("/dubbo/references", dubboReferencesMetadataEndpoint::references); + testHttpEndpoint("/dubbo/properties", dubboPropertiesEndpoint::properties); + } -@Service( - version = "${dubbo.service.version}", - application = "${dubbo.application.id}", - protocol = "${dubbo.protocol.id}", - registry = "${dubbo.registry.id}" -) -static class DefaultDemoService implements DemoService { - - public String sayHello(String name) { - return "Hello, " + name + " (from Spring Boot)"; + private void testHttpEndpoint(String actuatorURI, Supplier resultsSupplier) throws JsonProcessingException { + String actuatorURL = actuatorBaseURL + actuatorURI; + String response = restTemplate.getForObject(actuatorURL, String.class); + Assert.assertEquals(objectMapper.writeValueAsString(resultsSupplier.get()), response); } -} + + @Service( + version = "${dubbo.service.version}", + application = "${dubbo.application.id}", + protocol = "${dubbo.protocol.id}", + registry = "${dubbo.registry.id}" + ) + static class DefaultDemoService implements DemoService { + + public String sayHello(String name) { + return "Hello, " + name + " (from Spring Boot)"; + } + + } interface DemoService { String sayHello(String name); From 4cadcb6bf29bbb47d9175313d3eddff0f17fe34e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Mon, 7 Jan 2019 10:14:17 +0800 Subject: [PATCH 05/46] 0.2.1 (#357) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license --- dubbo-spring-boot-autoconfigure/pom.xml | 4 +- .../consumer-sample/pom.xml | 74 +++++++++++++++++++ ...bboAutoConfigurationConsumerBootstrap.java | 52 +++++++++++++ .../src/main/resources/application.yml | 3 + .../auto-configure-samples/pom.xml | 38 ++++++++++ .../provider-sample}/pom.xml | 28 +++---- ...boAutoConfigurationProviderBootstrap.java} | 15 ++-- .../provider/service/DefaultDemoService.java | 24 +++--- .../src/main/resources/application.properties | 12 +++ .../src/main/resources/application.yml | 37 ---------- .../src/main/resources/application.properties | 46 ------------ .../consumer-sample/pom.xml | 74 +++++++++++++++++++ ...nalizedConfigurationConsumerBootstrap.java | 50 +++++++++++++ .../src/main/resources/application.yml | 8 ++ .../pom.xml | 39 ++++++++++ .../provider-sample}/pom.xml | 49 ++---------- ...alizedConfigurationProviderBootstrap.java} | 20 ++--- .../provider/service/DefaultDemoService.java} | 34 ++++----- .../src/main/resources/application.properties | 19 +++++ dubbo-spring-boot-samples/pom.xml | 18 +---- .../pom.xml | 4 +- .../boot/dubbo/demo/consumer/DemoService.java | 4 +- 22 files changed, 436 insertions(+), 216 deletions(-) create mode 100644 dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml create mode 100644 dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java create mode 100644 dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/resources/application.yml create mode 100644 dubbo-spring-boot-samples/auto-configure-samples/pom.xml rename dubbo-spring-boot-samples/{dubbo-spring-boot-sample-consumer => auto-configure-samples/provider-sample}/pom.xml (75%) rename dubbo-spring-boot-samples/{dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboProviderDemo.java => auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboAutoConfigurationProviderBootstrap.java} (81%) rename dubbo-spring-boot-samples/{dubbo-spring-boot-sample-provider => auto-configure-samples/provider-sample}/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java (71%) create mode 100644 dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/resources/application.properties delete mode 100644 dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.yml delete mode 100644 dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application.properties create mode 100644 dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml create mode 100644 dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java create mode 100644 dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/resources/application.yml create mode 100644 dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml rename dubbo-spring-boot-samples/{dubbo-spring-boot-sample-provider => externalized-configuration-samples/provider-sample}/pom.xml (61%) rename dubbo-spring-boot-samples/{dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboConsumerDemo.java => externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboExternalizedConfigurationProviderBootstrap.java} (63%) rename dubbo-spring-boot-samples/{dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java => externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java} (54%) create mode 100644 dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/resources/application.properties rename dubbo-spring-boot-samples/{dubbo-spring-boot-sample-api => sample-api}/pom.xml (92%) rename dubbo-spring-boot-samples/{dubbo-spring-boot-sample-api => sample-api}/src/main/java/com/alibaba/boot/dubbo/demo/consumer/DemoService.java (89%) diff --git a/dubbo-spring-boot-autoconfigure/pom.xml b/dubbo-spring-boot-autoconfigure/pom.xml index ae2bae3fd..a7a7a3494 100644 --- a/dubbo-spring-boot-autoconfigure/pom.xml +++ b/dubbo-spring-boot-autoconfigure/pom.xml @@ -27,8 +27,8 @@ dubbo-spring-boot-autoconfigure jar - Dubbo Spring Boot AutoConfigure - Dubbo Spring Boot AutoConfigure + Dubbo Spring Boot Auto-Configure + Dubbo Spring Boot Auto-Configure diff --git a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml new file mode 100644 index 000000000..174159d63 --- /dev/null +++ b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml @@ -0,0 +1,74 @@ + + + + com.alibaba.boot.samples + dubbo-spring-boot-auto-configure-samples + 0.2.1-SNAPSHOT + ../pom.xml + + 4.0.0 + + dubbo-spring-boot-auto-configure-consumer-sample + Dubbo Spring Boot Samples : Auto-Configure :: Consumer Sample + + + + + org.springframework.boot + spring-boot-starter + + + + com.alibaba.boot + dubbo-spring-boot-starter + ${project.version} + + + + com.alibaba + dubbo + + + + ${project.groupId} + dubbo-spring-boot-sample-api + ${project.version} + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java new file mode 100644 index 000000000..d84b96e4c --- /dev/null +++ b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java @@ -0,0 +1,52 @@ +/* + * 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.demo.consumer.bootstrap; + +import com.alibaba.boot.dubbo.demo.consumer.DemoService; +import com.alibaba.dubbo.config.annotation.Reference; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.ApplicationRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Bean; + +/** + * Dubbo Auto Configuration Consumer Bootstrap + * + * @since 1.0.0 + */ +@EnableAutoConfiguration +public class DubboAutoConfigurationConsumerBootstrap { + + private final Logger logger = LoggerFactory.getLogger(getClass()); + + @Reference(version = "1.0.0", url = "dubbo://localhost:12345") + private DemoService demoService; + + @Bean + public ApplicationRunner runner() { + return args -> { + logger.info(demoService.sayHello("mercyblitz")); + }; + } + + public static void main(String[] args) { + SpringApplication.run(DubboAutoConfigurationConsumerBootstrap.class).close(); + } +} diff --git a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/resources/application.yml b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/resources/application.yml new file mode 100644 index 000000000..cb7b13317 --- /dev/null +++ b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/resources/application.yml @@ -0,0 +1,3 @@ +spring: + application: + name: dubbo-auto-configure-consumer-sample \ No newline at end of file diff --git a/dubbo-spring-boot-samples/auto-configure-samples/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/pom.xml new file mode 100644 index 000000000..3af94c34b --- /dev/null +++ b/dubbo-spring-boot-samples/auto-configure-samples/pom.xml @@ -0,0 +1,38 @@ + + + + com.alibaba.boot.samples + dubbo-spring-boot-samples + 0.2.1-SNAPSHOT + ../pom.xml + + 4.0.0 + + dubbo-spring-boot-auto-configure-samples + Dubbo Spring Boot Samples : Auto-Configure + Dubbo Spring Boot Auto-Configure Samples + pom + + + consumer-sample + provider-sample + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml similarity index 75% rename from dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml rename to dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml index 962dea625..75af9b506 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/pom.xml +++ b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml @@ -14,42 +14,31 @@ See the License for the specific language governing permissions and limitations under the License. --> - - com.alibaba.boot - dubbo-spring-boot-samples + com.alibaba.boot.samples + dubbo-spring-boot-auto-configure-samples 0.2.1-SNAPSHOT ../pom.xml 4.0.0 - dubbo-spring-boot-sample-consumer - Dubbo Spring Boot Sample : Consumer + dubbo-spring-boot-auto-configure-provider-sample + Dubbo Spring Boot Samples : Auto-Configure :: Provider Sample org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-actuator - - - - ${project.groupId} - dubbo-spring-boot-starter - ${project.version} + spring-boot-starter com.alibaba.boot - dubbo-spring-boot-actuator + dubbo-spring-boot-starter ${project.version} @@ -83,4 +72,5 @@ + \ 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/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboAutoConfigurationProviderBootstrap.java similarity index 81% rename from dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboProviderDemo.java rename to dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboAutoConfigurationProviderBootstrap.java index a25203216..012746bef 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/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboAutoConfigurationProviderBootstrap.java @@ -17,26 +17,23 @@ package com.alibaba.boot.dubbo.demo.provider.bootstrap; import com.alibaba.boot.dubbo.demo.provider.service.DefaultDemoService; + import org.springframework.boot.WebApplicationType; -import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; /** - * Dubbo Provider Demo + * Dubbo Auto-Configuration Provider Bootstrap * - * @author Mercy * @see DefaultDemoService * @since 1.0.0 */ -@SpringBootApplication -public class DubboProviderDemo { +@EnableAutoConfiguration +public class DubboAutoConfigurationProviderBootstrap { public static void main(String[] args) { - - new SpringApplicationBuilder(DubboProviderDemo.class) + new SpringApplicationBuilder(DubboAutoConfigurationProviderBootstrap.class) .web(WebApplicationType.NONE) .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/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java similarity index 71% rename from dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java rename to dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index eda8d4127..01dfccc3c 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/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -19,28 +19,24 @@ import com.alibaba.boot.dubbo.demo.consumer.DemoService; import com.alibaba.dubbo.config.annotation.Service; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.QueryParam; +import org.springframework.beans.factory.annotation.Value; /** * Default {@link DemoService} * - * @author Mercy * @see DemoService * @since 1.0.0 */ -@Service( - version = "${demo.service.version}", - protocol = {"dubbo", "rest"}, - registry = "${dubbo.registry.id}" -) -@Path("demo") +@Service(version = "1.0.0") public class DefaultDemoService implements DemoService { - @GET - @Path("/say-hello") - public String sayHello(@QueryParam("name") String name) { - return "Hello, " + name + " (from Spring Boot)"; + /** + * The default value of ${dubbo.application.name} is ${spring.application.name} + */ + @Value("${dubbo.application.name}") + private String serviceName; + + public String sayHello(String name) { + return String.format("[%s] : Hello, %s", serviceName, name); } } \ No newline at end of file diff --git a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/resources/application.properties b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/resources/application.properties new file mode 100644 index 000000000..85e8400e4 --- /dev/null +++ b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/resources/application.properties @@ -0,0 +1,12 @@ +# Spring boot application +spring.application.name=dubbo-auto-configuration-provider-demo +# Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service +dubbo.scan.base-packages=com.alibaba.boot.dubbo.demo.provider.service +# Dubbo Application +## The default value of dubbo.application.name is ${spring.application.name} +## dubbo.application.name=${spring.application.name} +# Dubbo Protocol +dubbo.protocol.name=dubbo +dubbo.protocol.port=12345 +## Dubbo Registry +dubbo.registry.address=N/A \ 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 deleted file mode 100644 index 9aad95db6..000000000 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.yml +++ /dev/null @@ -1,37 +0,0 @@ -spring: - application: - name: dubbo-consumer-demo - -server: - port: 8080 - -management: - server: - port: 8081 - -dubbo: - application: - id: ${spring.application.name} - logger: slf4j - protocol: - id: dubbo - name: dubbo - port: 12345 - ---- -spring: - profiles: prod - -endpoints: - dubbo: - enabled: true - -management: - health: - dubbo: - status: - defaults: memory - endpoints: - web: - exposure: - include: "*" \ 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 deleted file mode 100644 index b6f2c3a3e..000000000 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application.properties +++ /dev/null @@ -1,46 +0,0 @@ -# Spring boot application -spring.application.name = dubbo-provider-demo -server.port = 9090 - - -# DemoService service version -demo.service.version = 1.0.0 - -# Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service -dubbo.scan.base-packages = com.alibaba.boot.dubbo.demo.provider.service - - -# Dubbo Config properties -## ApplicationConfig Bean -dubbo.application.qos.port=0 -dubbo.application.qos.enable=true - - -## Enable multiple config bindings -dubbo.config.multiple =true - -## ProtocolConfig Bean -dubbo.protocols.dubbo.name = dubbo -dubbo.protocols.dubbo.port = 12345 -dubbo.protocols.dubbo.status = server - -dubbo.protocols.rest.name = rest -dubbo.protocols.rest.port = 8888 - -## RegistryConfig Bean -dubbo.registry.id = my-registry -dubbo.registry.address = N/A - -# Enables Dubbo All Endpoints -management.endpoint.dubbo.enabled = true -management.endpoint.dubboShutdown.enabled = true -management.endpoint.dubboConfigs.enabled = true -management.endpoint.dubboServices.enabled = true -management.endpoint.dubboReferences.enabled = true -management.endpoint.dubboProperties.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/externalized-configuration-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml new file mode 100644 index 000000000..3d4af183d --- /dev/null +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml @@ -0,0 +1,74 @@ + + + + com.alibaba.boot.samples + dubbo-spring-boot-externalized-configuration-samples + 0.2.1-SNAPSHOT + ../pom.xml + + 4.0.0 + + dubbo-spring-boot-externalized-configuration-consumer-sample + Dubbo Spring Boot Samples : Externalized Configuration :: Consumer Sample + + + + + org.springframework.boot + spring-boot-starter + + + + com.alibaba.boot + dubbo-spring-boot-starter + ${project.version} + + + + com.alibaba + dubbo + + + + ${project.groupId} + dubbo-spring-boot-sample-api + ${project.version} + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java new file mode 100644 index 000000000..2eb78b432 --- /dev/null +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java @@ -0,0 +1,50 @@ +/* + * 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.demo.consumer.bootstrap; + +import com.alibaba.boot.dubbo.demo.consumer.DemoService; +import com.alibaba.dubbo.config.annotation.Reference; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.ApplicationRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Bean; + +/** + * Dubbo Externalized Configuration Consumer Bootstrap + */ +@EnableAutoConfiguration +public class DubboExternalizedConfigurationConsumerBootstrap { + + private final Logger logger = LoggerFactory.getLogger(getClass()); + + @Reference(version = "${demo.service.version}", url = "${demo.service.url}") + private DemoService demoService; + + @Bean + public ApplicationRunner runner() { + return args -> { + logger.info(demoService.sayHello("mercyblitz")); + }; + } + + public static void main(String[] args) { + SpringApplication.run(DubboExternalizedConfigurationConsumerBootstrap.class).close(); + } +} diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/resources/application.yml b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/resources/application.yml new file mode 100644 index 000000000..e3aef4286 --- /dev/null +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/resources/application.yml @@ -0,0 +1,8 @@ +spring: + application: + name: dubbo-externalized-configuration-consumer-sample + +demo: + service: + version: 1.0.0 + url: dubbo://localhost:12345 \ No newline at end of file diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml new file mode 100644 index 000000000..b5298dfff --- /dev/null +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml @@ -0,0 +1,39 @@ + + + + com.alibaba.boot.samples + dubbo-spring-boot-samples + 0.2.1-SNAPSHOT + ../pom.xml + + 4.0.0 + + dubbo-spring-boot-externalized-configuration-samples + Dubbo Spring Boot Samples : Externalized Configuration + Dubbo Spring Boot Externalized Configuration Samples + pom + + + consumer-sample + provider-sample + + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml similarity index 61% rename from dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml rename to dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml index bb4eff8e7..7e2d9c705 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml @@ -14,19 +14,19 @@ See the License for the specific language governing permissions and limitations under the License. --> - - com.alibaba.boot - dubbo-spring-boot-samples + com.alibaba.boot.samples + dubbo-spring-boot-externalized-configuration-samples 0.2.1-SNAPSHOT ../pom.xml 4.0.0 - dubbo-spring-boot-sample-provider - Dubbo Spring Boot Sample : Provider + dubbo-spring-boot-externalized-configuration-provider-sample + Dubbo Spring Boot Samples : Externalized Configuration :: Provider Sample @@ -36,44 +36,9 @@ spring-boot-starter - - org.jboss.resteasy - resteasy-jaxrs - 3.0.19.Final - - - - javax.validation - validation-api - 1.1.0.Final - - - - org.mortbay.jetty - jetty - 6.1.26 - - - org.mortbay.jetty - servlet-api - - - - - - org.springframework.boot - spring-boot-starter-actuator - - - - ${project.groupId} - dubbo-spring-boot-starter - ${project.version} - - com.alibaba.boot - dubbo-spring-boot-actuator + dubbo-spring-boot-starter ${project.version} 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/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboExternalizedConfigurationProviderBootstrap.java similarity index 63% rename from dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboConsumerDemo.java rename to dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboExternalizedConfigurationProviderBootstrap.java index 7f10d51ea..6264c17f8 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/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboExternalizedConfigurationProviderBootstrap.java @@ -14,26 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.alibaba.boot.dubbo.demo.consumer.bootstrap; +package com.alibaba.boot.dubbo.demo.provider.bootstrap; -import com.alibaba.boot.dubbo.demo.consumer.controller.DemoConsumerController; +import com.alibaba.boot.dubbo.demo.provider.service.DefaultDemoService; -import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.WebApplicationType; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; /** - * Dubbo Consumer Demo + * Dubbo Externalized Configuration Provider Bootstrap * - * @author Mercy - * @see DemoConsumerController + * @see DefaultDemoService * @since 1.0.0 */ -@SpringBootApplication(scanBasePackages = "com.alibaba.boot.dubbo.demo.consumer.controller") -public class DubboConsumerDemo { +@EnableAutoConfiguration +public class DubboExternalizedConfigurationProviderBootstrap { public static void main(String[] args) { - new SpringApplicationBuilder(DubboConsumerDemo.class) - .profiles("prod") + new SpringApplicationBuilder(DubboExternalizedConfigurationProviderBootstrap.class) + .web(WebApplicationType.NONE) .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/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java similarity index 54% rename from dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java rename to dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index 99cb0fc1b..f1d9ae1c9 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/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -14,33 +14,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.alibaba.boot.dubbo.demo.consumer.controller; +package com.alibaba.boot.dubbo.demo.provider.service; import com.alibaba.boot.dubbo.demo.consumer.DemoService; -import com.alibaba.dubbo.config.annotation.Reference; +import com.alibaba.dubbo.config.annotation.Service; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.beans.factory.annotation.Value; /** - * Demo Consumer Controller (REST) + * Default {@link DemoService} * - * @author Mercy - * @see RestController + * @see DemoService * @since 1.0.0 */ -@RestController -public class DemoConsumerController { +@Service(version = "${demo.service.version}") +public class DefaultDemoService implements DemoService { - @Reference( - version = "${demo.service.version}", - url = "dubbo://localhost:12345") - private DemoService demoService; + /** + * The default value of ${dubbo.application.name} is ${spring.application.name} + */ + @Value("${dubbo.application.name}") + private String serviceName; - @RequestMapping("/sayHello") - public String sayHello(@RequestParam String name) { - return demoService.sayHello(name); + public String sayHello(String name) { + return String.format("[%s] : Hello, %s", serviceName, name); } - -} +} \ No newline at end of file diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/resources/application.properties b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/resources/application.properties new file mode 100644 index 000000000..398e99689 --- /dev/null +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/resources/application.properties @@ -0,0 +1,19 @@ +# Spring boot application +spring.application.name=dubbo-externalized-configuration-provider-sample + +# Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service +dubbo.scan.base-packages=com.alibaba.boot.dubbo.demo.provider.service + +# Dubbo Application +## The default value of dubbo.application.name is ${spring.application.name} +## dubbo.application.name=${spring.application.name} + +# Dubbo Protocol +dubbo.protocol.name=dubbo +dubbo.protocol.port=12345 + +## Dubbo Registry +dubbo.registry.address=N/A + +## DemoService version +demo.service.version=1.0.0 \ No newline at end of file diff --git a/dubbo-spring-boot-samples/pom.xml b/dubbo-spring-boot-samples/pom.xml index a1917a05c..07be5f495 100644 --- a/dubbo-spring-boot-samples/pom.xml +++ b/dubbo-spring-boot-samples/pom.xml @@ -25,27 +25,17 @@ 4.0.0 + com.alibaba.boot.samples dubbo-spring-boot-samples pom Dubbo Spring Boot Samples Dubbo Spring Boot Samples - dubbo-spring-boot-sample-provider - dubbo-spring-boot-sample-consumer - dubbo-spring-boot-sample-api + sample-api + auto-configure-samples + externalized-configuration-samples - - - - javax.servlet - javax.servlet-api - 3.1.0 - provided - - - - diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml b/dubbo-spring-boot-samples/sample-api/pom.xml similarity index 92% rename from dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml rename to dubbo-spring-boot-samples/sample-api/pom.xml index bac2c4c25..f58e9760d 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/pom.xml +++ b/dubbo-spring-boot-samples/sample-api/pom.xml @@ -18,7 +18,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - com.alibaba.boot + com.alibaba.boot.samples dubbo-spring-boot-samples 0.2.1-SNAPSHOT ../pom.xml @@ -26,6 +26,6 @@ 4.0.0 dubbo-spring-boot-sample-api - Dubbo Spring Boot Sample : API + Dubbo Spring Boot Samples : API \ No newline at end of file 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/sample-api/src/main/java/com/alibaba/boot/dubbo/demo/consumer/DemoService.java similarity index 89% rename from dubbo-spring-boot-samples/dubbo-spring-boot-sample-api/src/main/java/com/alibaba/boot/dubbo/demo/consumer/DemoService.java rename to dubbo-spring-boot-samples/sample-api/src/main/java/com/alibaba/boot/dubbo/demo/consumer/DemoService.java index f57c8e4cc..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/sample-api/src/main/java/com/alibaba/boot/dubbo/demo/consumer/DemoService.java @@ -1,4 +1,4 @@ -package com.alibaba.boot.dubbo.demo.consumer;/* +/* * 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. @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package com.alibaba.boot.dubbo.demo.consumer; /** * Demo Service interface * - * @author Mercy * @since 1.0.0 */ public interface DemoService { From dae491313d33ec2abcfacacd462d6f7c32c339b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Tue, 8 Jan 2019 11:37:00 +0800 Subject: [PATCH 06/46] 0.2.1 (#360) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases --- README.md | 274 ++++++++---------- dubbo-spring-boot-autoconfigure/pom.xml | 2 +- ...ultPropertiesEnvironmentPostProcessor.java | 20 ++ ...AutoConfigurationOnMultipleConfigTest.java | 4 +- ...boAutoConfigurationOnSingleConfigTest.java | 5 +- ...ropertiesEnvironmentPostProcessorTest.java | 18 +- dubbo-spring-boot-parent/pom.xml | 67 ++--- .../consumer-sample/pom.xml | 93 ++++++ .../DubboRegistryNacosConsumerBootstrap.java | 50 ++++ .../src/main/resources/application.yml | 11 + .../dubbo-registry-nacos-samples/pom.xml | 38 +++ .../provider-sample/pom.xml | 94 ++++++ .../DubboRegistryNacosProviderBootstrap.java | 39 +++ .../provider/service/DefaultDemoService.java | 42 +++ .../src/main/resources/application.properties | 20 ++ .../consumer-sample/pom.xml | 79 +++++ ...bboRegistryZooKeeperConsumerBootstrap.java | 50 ++++ .../src/main/resources/application.yml | 15 + .../dubbo-registry-zookeeper-samples/pom.xml | 38 +++ .../provider-sample/pom.xml | 88 ++++++ ...bboRegistryZooKeeperProviderBootstrap.java | 47 +++ .../provider/bootstrap/EmbeddedZooKeeper.java | 252 ++++++++++++++++ .../provider/service/DefaultDemoService.java | 42 +++ .../src/main/resources/application.properties | 22 ++ dubbo-spring-boot-samples/pom.xml | 3 + 25 files changed, 1205 insertions(+), 208 deletions(-) create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/resources/application.yml create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboRegistryNacosProviderBootstrap.java create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/resources/application.properties create mode 100644 dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml create mode 100644 dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java create mode 100644 dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/resources/application.yml create mode 100644 dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/pom.xml create mode 100644 dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml create mode 100644 dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboRegistryZooKeeperProviderBootstrap.java create mode 100644 dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/EmbeddedZooKeeper.java create mode 100644 dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java create mode 100644 dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties diff --git a/README.md b/README.md index 1d90f7ad6..34ca0d383 100644 --- a/README.md +++ b/README.md @@ -20,24 +20,50 @@ 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.2.1-SNAPSHOT - - - - - com.alibaba - dubbo - 2.6.5 - - - - com.alibaba.spring - spring-context-support - 1.0.2 - + + 2.1.1.RELEASE + 2.6.5 + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + com.alibaba + dubbo-dependencies-bom + ${dubbo.version} + pom + import + + + + + + + + com.alibaba.boot + dubbo-spring-boot-starter + 0.2.1-SNAPSHOT + + + com.alibaba + dubbo + ${dubbo.version} + + + io.netty + netty-all + + ``` If your project failed to resolve the dependency, try to add the following repository: @@ -78,7 +104,7 @@ If you'd like to attempt to experience latest features, you also can build from | versions | Java | Spring Boot | Dubbo | | -------- | ----- | ----------- | ---------- | -| `0.2.0` | 1.8+ | `2.0.x` | `2.6.2` + | +| `0.2.1` | 1.8+ | `2.1.x` | `2.6.2` + | | `0.1.1` | 1.7+ | `1.5.x` | `2.6.2` + | @@ -103,148 +129,108 @@ public interface DemoService { ### Dubbo service(s) provider -Service Provider implements `DemoService`: - -```java -@Service( - version = "1.0.0", - application = "${dubbo.application.id}", - protocol = "${dubbo.protocol.id}", - registry = "${dubbo.registry.id}" -) -public class DefaultDemoService implements DemoService { - - public String sayHello(String name) { - return "Hello, " + name + " (from Spring Boot)"; - } - -} -``` - +1. Service Provider implements `DemoService` + ```java + @Service(version = "1.0.0") + public class DefaultDemoService implements DemoService { -then, provides a bootstrap class: - -```java -@SpringBootApplication -public class DubboProviderDemo { - - public static void main(String[] args) { - - SpringApplication.run(DubboProviderDemo.class,args); + /** + * The default value of ${dubbo.application.name} is ${spring.application.name} + */ + @Value("${dubbo.application.name}") + private String serviceName; + public String sayHello(String name) { + return String.format("[%s] : Hello, %s", serviceName, name); + } } + ``` -} -``` - +2. Provides a bootstrap class + ```java + @EnableAutoConfiguration + public class DubboProviderDemo { -last, configures `application.properties`: - -```properties -# Spring boot application -spring.application.name = dubbo-provider-demo -server.port = 9090 -management.port = 9091 - -# 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 - -## ProtocolConfig Bean -dubbo.protocol.id = dubbo -dubbo.protocol.name = dubbo -dubbo.protocol.port = 12345 - -## RegistryConfig Bean -dubbo.registry.id = my-registry -dubbo.registry.address = N/A -``` + public static void main(String[] args) { + SpringApplication.run(DubboProviderDemo.class,args); + } + } + ``` +3. Configures the `application.properties`: + ```properties + # Spring boot application + spring.application.name=dubbo-auto-configuration-provider-demo -`DefaultDemoService`'s placeholders( `${dubbo.application.id}`, `${dubbo.protocol.id}`, `${dubbo.registry.id}` ) sources from `application.properties`. + # Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service + dubbo.scan.base-packages=com.alibaba.boot.dubbo.demo.provider.service + # Dubbo Application + ## The default value of dubbo.application.name is ${spring.application.name} + ## dubbo.application.name=${spring.application.name} + # Dubbo Protocol + dubbo.protocol.name=dubbo + dubbo.protocol.port=12345 -More details, please refer to [Dubbo Provider Sample](dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider). + ## Dubbo Registry + dubbo.registry.address=N/A + ``` ### Dubbo service(s) consumer +1. Service consumer also provides a bootstrap class to reference `DemoService` + ```java + @EnableAutoConfiguration + public class DubboConsumerBootstrap { -Service consumer requires Spring Beans to reference `DemoService`: - -```java -@RestController -public class DemoConsumerController { - - @Reference(version = "1.0.0", - application = "${dubbo.application.id}", - url = "dubbo://localhost:12345") - private DemoService demoService; - - @RequestMapping("/sayHello") - public String sayHello(@RequestParam String name) { - return demoService.sayHello(name); - } - -} -``` - - - -then, also provide a bootstrap class: - -```java -@SpringBootApplication(scanBasePackages = "com.alibaba.boot.dubbo.demo.consumer.controller") -public class DubboConsumerDemo { + private final Logger logger = LoggerFactory.getLogger(getClass()); - public static void main(String[] args) { + @Reference(version = "1.0.0", url = "dubbo://localhost:12345") + private DemoService demoService; - SpringApplication.run(DubboConsumerDemo.class,args); + @Bean + public ApplicationRunner runner() { + return args -> { + logger.info(demoService.sayHello("mercyblitz")); + }; + } + public static void main(String[] args) { + SpringApplication.run(DubboConsumerBootstrap.class).close(); + } } + ``` -} -``` - - +2. configures `application.properties` -last, configures `application.properties`: + ```properties + # Spring boot application + spring.application.name = dubbo-consumer-demo + server.port = 8080 + management.port = 8081 -```properties -# Spring boot application -spring.application.name = dubbo-consumer-demo -server.port = 8080 -management.port = 8081 + # Dubbo Config properties + ## ApplicationConfig Bean + dubbo.application.id = dubbo-consumer-demo + dubbo.application.name = dubbo-consumer-demo -# Dubbo Config properties -## ApplicationConfig Bean -dubbo.application.id = dubbo-consumer-demo -dubbo.application.name = dubbo-consumer-demo - -## ProtocolConfig Bean -dubbo.protocol.id = dubbo -dubbo.protocol.name = dubbo -dubbo.protocol.port = 12345 -``` - + ## ProtocolConfig Bean + dubbo.protocol.id = dubbo + dubbo.protocol.name = dubbo + dubbo.protocol.port = 12345 + ``` +If `DubboProviderDemo` works well, please mark sure `DubboProviderDemo` is started. -If `DubboProviderDemo` works well, please mark sure Dubbo service(s) is active. - - - -More details, please refer to [Dubbo Consumer Sample](dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer) +More details, please refer to [Samples](dubbo-spring-boot-samples). @@ -261,7 +247,7 @@ Having trouble with Dubbo Spring Boot? We’d like to help! ## Building from Source -If you want to try out thr latest features of Dubbo Spring Boot, it can be easily built with the [maven wrapper](https://github.com/takari/maven-wrapper). Your JDK is 1.7 or above. +If you want to try out thr latest features of Dubbo Spring Boot, it can be easily built with the [maven wrapper](https://github.com/takari/maven-wrapper). Your JDK is 1.8 or above. ``` $ ./mvnw clean install @@ -301,24 +287,10 @@ The main usage of `dubbo-spring-boot-parent` is providing dependencies managemen ### [dubbo-spring-boot-samples](dubbo-spring-boot-samples) -The samples project of Dubbo Spring Boot that includes two parts: - - - -#### [Dubbo Provider Sample](dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider) - -Dubbo Service will be exported on localhost with port `12345`. - -* [Health Checks](dubbo-spring-boot-actuator#health-checks): http://localhost:9091/health -* [Dubbo Endpoint](dubbo-spring-boot-actuator#endpoints): http://localhost:9091/dubbo - - - -#### [Dubbo Consumer Sample](dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer) - -Dubbo Service will be consumed at Spring WebMVC `Controller`. - -* Demo `Controller`: http://localhost:8080/sayHello?name=HelloWorld -* [Health Checks](dubbo-spring-boot-actuator#health-checks): http://localhost:8081/actuator/health -* [Dubbo Endpoint](dubbo-spring-boot-actuator#endpoints): http://localhost:8081/actuator/dubbo +The samples project of Dubbo Spring Boot that includes: +- [Auto-Configuaration Samples](dubbo-spring-boot-samples/auto-configure-samples) +- [Externalized Configuration Samples](dubbo-spring-boot-samples/externalized-configuration-samples) +- [Registry Zookeeper Samples](dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples) +- [Registry Nacos Samples](dubbo-spring-boot-samples/dubbo-registry-nacos-samples) +- [Sample API](dubbo-spring-boot-samples/sample-api) \ No newline at end of file diff --git a/dubbo-spring-boot-autoconfigure/pom.xml b/dubbo-spring-boot-autoconfigure/pom.xml index a7a7a3494..6fb2ea3da 100644 --- a/dubbo-spring-boot-autoconfigure/pom.xml +++ b/dubbo-spring-boot-autoconfigure/pom.xml @@ -21,7 +21,7 @@ com.alibaba.boot dubbo-spring-boot-parent 0.2.1-SNAPSHOT - ../dubbo-spring-boot-parent + ../dubbo-spring-boot-parent/pom.xml 4.0.0 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 index d8a671b95..3292bf9fa 100644 --- 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 @@ -64,6 +64,16 @@ public class DubboDefaultPropertiesEnvironmentPostProcessor implements Environme */ private static final String DUBBO_APPLICATION_NAME_PROPERTY = "dubbo.application.name"; + /** + * The property name of {@link EnableDubboConfig#multiple() @EnableDubboConfig.multiple()} + */ + private static final String DUBBO_CONFIG_MULTIPLE_PROPERTY = "dubbo.config.multiple"; + + /** + * The property name of {@link ApplicationConfig#getQosEnable() application's QOS enable} + */ + private static final String DUBBO_APPLICATION_QOS_ENABLE_PROPERTY = "dubbo.application.qos-enable"; + @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { MutablePropertySources propertySources = environment.getPropertySources(); @@ -81,6 +91,8 @@ public int getOrder() { private Map createDefaultProperties(ConfigurableEnvironment environment) { Map defaultProperties = new HashMap(); setDubboApplicationNameProperty(environment, defaultProperties); + setDubboConfigMultipleProperty(defaultProperties); + setDubboApplicationQosEnableProperty(defaultProperties); return defaultProperties; } @@ -92,6 +104,14 @@ private void setDubboApplicationNameProperty(Environment environment, Map defaultProperties) { + defaultProperties.put(DUBBO_CONFIG_MULTIPLE_PROPERTY, Boolean.TRUE.toString()); + } + + private void setDubboApplicationQosEnableProperty(Map defaultProperties) { + defaultProperties.put(DUBBO_APPLICATION_QOS_ENABLE_PROPERTY, Boolean.FALSE.toString()); + } + /** * Copy from BusEnvironmentPostProcessor#addOrReplace(MutablePropertySources, Map) * 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 af38587b8..4163ac05d 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 @@ -153,7 +153,7 @@ public class DubboAutoConfigurationOnMultipleConfigTest { public void testMultipleDubboConfigBindingProperties() { - Assert.assertEquals(2, applications.size()); + Assert.assertEquals(3, applications.size()); Assert.assertEquals(1, modules.size()); @@ -177,7 +177,7 @@ public void testApplicationContext() { */ Map applications = beansOfTypeIncludingAncestors(applicationContext, ApplicationConfig.class); - Assert.assertEquals(2, applications.size()); + Assert.assertEquals(3, applications.size()); /** * Multiple {@link ModuleConfig} 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 b60340e75..7f4cd5e16 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 @@ -39,7 +39,6 @@ /** * {@link DubboAutoConfiguration} Test On single Dubbo Configuration * - * * @since 1.0.0 */ @RunWith(SpringJUnit4ClassRunner.class) @@ -151,7 +150,7 @@ public void testConsumerConfig() { @Test public void testMultipleDubboConfigConfiguration() { - Assert.assertNull(multipleDubboConfigConfiguration); + Assert.assertNotNull(multipleDubboConfigConfiguration); } @Test @@ -161,7 +160,7 @@ public void testSingleDubboConfigConfiguration() { @Test public void testServiceAnnotationBeanPostProcessor() { - Assert.assertNull(multipleDubboConfigConfiguration); + Assert.assertNotNull(multipleDubboConfigConfiguration); } } 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 index 626f2c9c6..d941a4f4c 100644 --- 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 @@ -51,7 +51,9 @@ public void testPostProcessEnvironment() { MutablePropertySources propertySources = environment.getPropertySources(); // Nothing to change PropertySource defaultPropertySource = propertySources.get("defaultProperties"); - Assert.assertNull(defaultPropertySource); + Assert.assertNotNull(defaultPropertySource); + Assert.assertEquals("true", defaultPropertySource.getProperty("dubbo.config.multiple")); + Assert.assertEquals("false", defaultPropertySource.getProperty("dubbo.application.qos-enable")); // Case 2 : Only set property "spring.application.name" environment.setProperty("spring.application.name", "demo-dubbo-application"); @@ -67,7 +69,7 @@ public void testPostProcessEnvironment() { environment.setProperty("dubbo.application.name", "demo-dubbo-application"); instance.postProcessEnvironment(environment, springApplication); defaultPropertySource = propertySources.get("defaultProperties"); - Assert.assertNull(defaultPropertySource); + Assert.assertNotNull(defaultPropertySource); dubboApplicationName = environment.getProperty("dubbo.application.name"); Assert.assertEquals("demo-dubbo-application", dubboApplicationName); @@ -81,5 +83,15 @@ public void testPostProcessEnvironment() { defaultPropertySource = propertySources.get("defaultProperties"); dubboApplicationName = defaultPropertySource.getProperty("dubbo.application.name"); Assert.assertEquals("demo-dubbo-application", dubboApplicationName); + + // Case 5 : Rest dubbo.config.multiple and dubbo.application.qos-enable + environment = new MockEnvironment(); + propertySources = environment.getPropertySources(); + propertySources.addLast(new MapPropertySource("defaultProperties", new HashMap())); + environment.setProperty("dubbo.config.multiple", "false"); + environment.setProperty("dubbo.application.qos-enable", "true"); + instance.postProcessEnvironment(environment, springApplication); + Assert.assertEquals("false", environment.getProperty("dubbo.config.multiple")); + Assert.assertEquals("true", environment.getProperty("dubbo.application.qos-enable")); } -} +} \ No newline at end of file diff --git a/dubbo-spring-boot-parent/pom.xml b/dubbo-spring-boot-parent/pom.xml index 82ab7009e..5b5d29eb1 100644 --- a/dubbo-spring-boot-parent/pom.xml +++ b/dubbo-spring-boot-parent/pom.xml @@ -39,9 +39,8 @@ UTF-8 2.1.1.RELEASE 2.6.5 - 0.2 - 3.4.9 - 2.12.0 + 0.0.2 + 0.6.2 -server -Xms256m -Xmx512m -XX:PermSize=64m -XX:MaxPermSize=128m -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true @@ -62,7 +61,6 @@ - org.springframework.boot @@ -72,6 +70,15 @@ import + + + com.alibaba + dubbo-dependencies-bom + ${dubbo.version} + pom + import + + com.alibaba @@ -93,54 +100,18 @@ - + - com.alibaba.spring - spring-context-support - ${alibaba-spring-context-support.version} - - - - - org.apache.zookeeper - zookeeper - ${zookeeper.version} - - - org.slf4j - slf4j-log4j12 - - - log4j - log4j - - - - - - com.101tec - zkclient - ${zkclient.version} - - - slf4j-api - org.slf4j - - - log4j - log4j - - - slf4j-log4j12 - org.slf4j - - + com.alibaba + dubbo-registry-nacos + ${dubbo-registry-nacos.version} + - org.apache.curator - curator-framework - ${curator-framework.version} + com.alibaba.nacos + nacos-client + ${nacos-client.version} diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml new file mode 100644 index 000000000..1da62fc53 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml @@ -0,0 +1,93 @@ + + + + com.alibaba.boot.samples + dubbo-spring-boot-registry-nacos-samples + 0.2.1-SNAPSHOT + ../pom.xml + + 4.0.0 + + dubbo-spring-boot-registry-nacos-consumer-sample + Dubbo Spring Boot Samples : Registry Nacos :: Consumer Sample + + + + + org.springframework.boot + spring-boot-starter + + + + com.alibaba.boot + dubbo-spring-boot-starter + ${project.version} + + + + + com.alibaba + dubbo + + + + ${project.groupId} + dubbo-spring-boot-sample-api + ${project.version} + + + + + io.netty + netty-all + + + + + com.alibaba + dubbo-registry-nacos + + + + + com.alibaba.nacos + nacos-client + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java new file mode 100644 index 000000000..408fe5e18 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java @@ -0,0 +1,50 @@ +/* + * 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.demo.consumer.bootstrap; + +import com.alibaba.boot.dubbo.demo.consumer.DemoService; +import com.alibaba.dubbo.config.annotation.Reference; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.ApplicationRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Bean; + +/** + * Dubbo Registry Nacos Consumer Bootstrap + */ +@EnableAutoConfiguration +public class DubboRegistryNacosConsumerBootstrap { + + private final Logger logger = LoggerFactory.getLogger(getClass()); + + @Reference(version = "${demo.service.version}") + private DemoService demoService; + + @Bean + public ApplicationRunner runner() { + return args -> { + logger.info(demoService.sayHello("mercyblitz")); + }; + } + + public static void main(String[] args) { + SpringApplication.run(DubboRegistryNacosConsumerBootstrap.class).close(); + } +} diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/resources/application.yml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/resources/application.yml new file mode 100644 index 000000000..7889cf709 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/resources/application.yml @@ -0,0 +1,11 @@ +spring: + application: + name: dubbo-registry-nacos-consumer-sample + +demo: + service: + version: 1.0.0 + +dubbo: + registry: + address: nacos://127.0.0.1:8848 \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml new file mode 100644 index 000000000..a9c399575 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml @@ -0,0 +1,38 @@ + + + + com.alibaba.boot.samples + dubbo-spring-boot-samples + 0.2.1-SNAPSHOT + ../pom.xml + + 4.0.0 + + dubbo-spring-boot-registry-nacos-samples + Dubbo Spring Boot Samples : Registry Nacos + Dubbo Spring Boot Registry Nacos Samples + pom + + + consumer-sample + provider-sample + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml new file mode 100644 index 000000000..899b26380 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml @@ -0,0 +1,94 @@ + + + + com.alibaba.boot.samples + dubbo-spring-boot-registry-nacos-samples + 0.2.1-SNAPSHOT + ../pom.xml + + 4.0.0 + + dubbo-spring-boot-registry-nacos-provider-sample + Dubbo Spring Boot Samples : Registry Nacos :: Provider Sample + + + + + + org.springframework.boot + spring-boot-starter-web + + + + com.alibaba.boot + dubbo-spring-boot-starter + ${project.version} + + + + + com.alibaba + dubbo + + + + ${project.groupId} + dubbo-spring-boot-sample-api + ${project.version} + + + + + io.netty + netty-all + + + + + com.alibaba + dubbo-registry-nacos + + + + + com.alibaba.nacos + nacos-client + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboRegistryNacosProviderBootstrap.java b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboRegistryNacosProviderBootstrap.java new file mode 100644 index 000000000..361a392b6 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboRegistryNacosProviderBootstrap.java @@ -0,0 +1,39 @@ +/* + * 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.demo.provider.bootstrap; + +import com.alibaba.boot.dubbo.demo.provider.service.DefaultDemoService; + +import org.springframework.boot.WebApplicationType; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.builder.SpringApplicationBuilder; + +/** + * Dubbo Registry ZooKeeper Provider Bootstrap + * + * @see DefaultDemoService + * @since 1.0.0 + */ +@EnableAutoConfiguration +public class DubboRegistryNacosProviderBootstrap { + + public static void main(String[] args) { + new SpringApplicationBuilder(DubboRegistryNacosProviderBootstrap.class) + .web(WebApplicationType.NONE) + .run(); + } +} diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java new file mode 100644 index 000000000..f1d9ae1c9 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -0,0 +1,42 @@ +/* + * 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.demo.provider.service; + +import com.alibaba.boot.dubbo.demo.consumer.DemoService; +import com.alibaba.dubbo.config.annotation.Service; + +import org.springframework.beans.factory.annotation.Value; + +/** + * Default {@link DemoService} + * + * @see DemoService + * @since 1.0.0 + */ +@Service(version = "${demo.service.version}") +public class DefaultDemoService implements DemoService { + + /** + * The default value of ${dubbo.application.name} is ${spring.application.name} + */ + @Value("${dubbo.application.name}") + private String serviceName; + + public String sayHello(String name) { + return String.format("[%s] : Hello, %s", serviceName, name); + } +} \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/resources/application.properties b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/resources/application.properties new file mode 100644 index 000000000..91635fb70 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/resources/application.properties @@ -0,0 +1,20 @@ +# Spring boot application +spring.application.name=dubbo-registry-nacos-provider-sample + +# Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service +dubbo.scan.base-packages=com.alibaba.boot.dubbo.demo.provider.service + +# Dubbo Application +## The default value of dubbo.application.name is ${spring.application.name} +## dubbo.application.name=${spring.application.name} + +# Dubbo Protocol +dubbo.protocol.name=dubbo +## Random port +dubbo.protocol.port=-1 + +## Dubbo Registry +dubbo.registry.address=nacos://127.0.0.1:8848 + +## DemoService version +demo.service.version=1.0.0 \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml new file mode 100644 index 000000000..cbf9b368c --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml @@ -0,0 +1,79 @@ + + + + com.alibaba.boot.samples + dubbo-spring-boot-registry-zookeeper-samples + 0.2.1-SNAPSHOT + ../pom.xml + + 4.0.0 + + dubbo-spring-boot-registry-zookeeper-consumer-sample + Dubbo Spring Boot Samples : Registry Zookeeper :: Consumer Sample + + + + + org.springframework.boot + spring-boot-starter + + + + com.alibaba.boot + dubbo-spring-boot-starter + ${project.version} + + + + com.alibaba + dubbo + + + + ${project.groupId} + dubbo-spring-boot-sample-api + ${project.version} + + + + org.apache.curator + curator-framework + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java new file mode 100644 index 000000000..1b7935bb1 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java @@ -0,0 +1,50 @@ +/* + * 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.demo.consumer.bootstrap; + +import com.alibaba.boot.dubbo.demo.consumer.DemoService; +import com.alibaba.dubbo.config.annotation.Reference; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.ApplicationRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Bean; + +/** + * Dubbo Registry ZooKeeper Consumer Bootstrap + */ +@EnableAutoConfiguration +public class DubboRegistryZooKeeperConsumerBootstrap { + + private final Logger logger = LoggerFactory.getLogger(getClass()); + + @Reference(version = "${demo.service.version}") + private DemoService demoService; + + @Bean + public ApplicationRunner runner() { + return args -> { + logger.info(demoService.sayHello("mercyblitz")); + }; + } + + public static void main(String[] args) { + SpringApplication.run(DubboRegistryZooKeeperConsumerBootstrap.class).close(); + } +} diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/resources/application.yml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/resources/application.yml new file mode 100644 index 000000000..88846fbed --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/resources/application.yml @@ -0,0 +1,15 @@ +spring: + application: + name: dubbo-registry-zookeeper-consumer-sample + +demo: + service: + version: 1.0.0 + +embedded: + zookeeper: + port: 2181 + +dubbo: + registry: + address: zookeeper://127.0.0.1:${embedded.zookeeper.port} \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/pom.xml new file mode 100644 index 000000000..a07218d68 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/pom.xml @@ -0,0 +1,38 @@ + + + + com.alibaba.boot.samples + dubbo-spring-boot-samples + 0.2.1-SNAPSHOT + ../pom.xml + + 4.0.0 + + dubbo-spring-boot-registry-zookeeper-samples + Dubbo Spring Boot Samples : Registry Zookeeper + Dubbo Spring Boot Registry Zookeeper Samples + pom + + + consumer-sample + provider-sample + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml new file mode 100644 index 000000000..eba5f196d --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml @@ -0,0 +1,88 @@ + + + + com.alibaba.boot.samples + dubbo-spring-boot-registry-zookeeper-samples + 0.2.1-SNAPSHOT + ../pom.xml + + 4.0.0 + + dubbo-spring-boot-registry-zookeeper-provider-sample + Dubbo Spring Boot Samples : Registry Zookeeper :: Provider Sample + + + + + + org.springframework.boot + spring-boot-starter + + + + com.alibaba.boot + dubbo-spring-boot-starter + ${project.version} + + + + + com.alibaba + dubbo + + + + ${project.groupId} + dubbo-spring-boot-sample-api + ${project.version} + + + + + org.apache.zookeeper + zookeeper + + + + org.apache.curator + curator-framework + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboRegistryZooKeeperProviderBootstrap.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboRegistryZooKeeperProviderBootstrap.java new file mode 100644 index 000000000..bcc940760 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/DubboRegistryZooKeeperProviderBootstrap.java @@ -0,0 +1,47 @@ +/* + * 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.demo.provider.bootstrap; + +import com.alibaba.boot.dubbo.demo.provider.service.DefaultDemoService; + +import org.springframework.boot.WebApplicationType; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; +import org.springframework.context.ApplicationListener; +import org.springframework.core.env.Environment; + +/** + * Dubbo Registry ZooKeeper Provider Bootstrap + * + * @see DefaultDemoService + * @since 1.0.0 + */ +@EnableAutoConfiguration +public class DubboRegistryZooKeeperProviderBootstrap { + + public static void main(String[] args) { + new SpringApplicationBuilder(DubboRegistryZooKeeperProviderBootstrap.class) + .web(WebApplicationType.NONE) + .listeners((ApplicationListener) event -> { + Environment environment = event.getEnvironment(); + int port = environment.getProperty("embedded.zookeeper.port", int.class); + new EmbeddedZooKeeper(port, false).start(); + }) + .run(args); + } +} diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/EmbeddedZooKeeper.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/EmbeddedZooKeeper.java new file mode 100644 index 000000000..ced63442b --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/bootstrap/EmbeddedZooKeeper.java @@ -0,0 +1,252 @@ +/* + * 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.demo.provider.bootstrap; + + +import org.apache.zookeeper.server.ServerConfig; +import org.apache.zookeeper.server.ZooKeeperServerMain; +import org.apache.zookeeper.server.quorum.QuorumPeerConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.SmartLifecycle; +import org.springframework.util.ErrorHandler; +import org.springframework.util.SocketUtils; + +import java.io.File; +import java.lang.reflect.Method; +import java.util.Properties; +import java.util.UUID; + +/** + * from: https://github.com/spring-projects/spring-xd/blob/v1.3.1.RELEASE/spring-xd-dirt/src/main/java/org/springframework/xd/dirt/zookeeper/ZooKeeperUtils.java + *

+ * Helper class to start an embedded instance of standalone (non clustered) ZooKeeper. + *

+ * NOTE: at least an external standalone server (if not an ensemble) are recommended, even for + * org.springframework.xd.dirt.server.singlenode.SingleNodeApplication + * + * @author Patrick Peralta + * @author Mark Fisher + * @author David Turanski + */ +public class EmbeddedZooKeeper implements SmartLifecycle { + + /** + * Logger. + */ + private static final Logger logger = LoggerFactory.getLogger(EmbeddedZooKeeper.class); + + /** + * ZooKeeper client port. This will be determined dynamically upon startup. + */ + private final int clientPort; + + /** + * Whether to auto-start. Default is true. + */ + private boolean autoStartup = true; + + /** + * Lifecycle phase. Default is 0. + */ + private int phase = 0; + + /** + * Thread for running the ZooKeeper server. + */ + private volatile Thread zkServerThread; + + /** + * ZooKeeper server. + */ + private volatile ZooKeeperServerMain zkServer; + + /** + * {@link ErrorHandler} to be invoked if an Exception is thrown from the ZooKeeper server thread. + */ + private ErrorHandler errorHandler; + + private boolean daemon = true; + + /** + * Construct an EmbeddedZooKeeper with a random port. + */ + public EmbeddedZooKeeper() { + clientPort = SocketUtils.findAvailableTcpPort(); + } + + /** + * Construct an EmbeddedZooKeeper with the provided port. + * + * @param clientPort port for ZooKeeper server to bind to + */ + public EmbeddedZooKeeper(int clientPort, boolean daemon) { + this.clientPort = clientPort; + this.daemon = daemon; + } + + /** + * Returns the port that clients should use to connect to this embedded server. + * + * @return dynamically determined client port + */ + public int getClientPort() { + return this.clientPort; + } + + /** + * Specify whether to start automatically. Default is true. + * + * @param autoStartup whether to start automatically + */ + public void setAutoStartup(boolean autoStartup) { + this.autoStartup = autoStartup; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isAutoStartup() { + return this.autoStartup; + } + + /** + * Specify the lifecycle phase for the embedded server. + * + * @param phase the lifecycle phase + */ + public void setPhase(int phase) { + this.phase = phase; + } + + /** + * {@inheritDoc} + */ + @Override + public int getPhase() { + return this.phase; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isRunning() { + return (zkServerThread != null); + } + + /** + * Start the ZooKeeper server in a background thread. + *

+ * Register an error handler via {@link #setErrorHandler} in order to handle + * any exceptions thrown during startup or execution. + */ + @Override + public synchronized void start() { + if (zkServerThread == null) { + zkServerThread = new Thread(new ServerRunnable(), "ZooKeeper Server Starter"); + zkServerThread.setDaemon(daemon); + zkServerThread.start(); + } + } + + /** + * Shutdown the ZooKeeper server. + */ + @Override + public synchronized void stop() { + if (zkServerThread != null) { + // The shutdown method is protected...thus this hack to invoke it. + // This will log an exception on shutdown; see + // https://issues.apache.org/jira/browse/ZOOKEEPER-1873 for details. + try { + Method shutdown = ZooKeeperServerMain.class.getDeclaredMethod("shutdown"); + shutdown.setAccessible(true); + shutdown.invoke(zkServer); + } catch (Exception e) { + throw new RuntimeException(e); + } + + // It is expected that the thread will exit after + // the server is shutdown; this will block until + // the shutdown is complete. + try { + zkServerThread.join(5000); + zkServerThread = null; + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + logger.warn("Interrupted while waiting for embedded ZooKeeper to exit"); + // abandoning zk thread + zkServerThread = null; + } + } + } + + /** + * Stop the server if running and invoke the callback when complete. + */ + @Override + public void stop(Runnable callback) { + stop(); + callback.run(); + } + + /** + * Provide an {@link ErrorHandler} to be invoked if an Exception is thrown from the ZooKeeper server thread. If none + * is provided, only error-level logging will occur. + * + * @param errorHandler the {@link ErrorHandler} to be invoked + */ + public void setErrorHandler(ErrorHandler errorHandler) { + this.errorHandler = errorHandler; + } + + /** + * Runnable implementation that starts the ZooKeeper server. + */ + private class ServerRunnable implements Runnable { + + @Override + public void run() { + try { + Properties properties = new Properties(); + File file = new File(System.getProperty("java.io.tmpdir") + + File.separator + UUID.randomUUID()); + file.deleteOnExit(); + properties.setProperty("dataDir", file.getAbsolutePath()); + properties.setProperty("clientPort", String.valueOf(clientPort)); + + QuorumPeerConfig quorumPeerConfig = new QuorumPeerConfig(); + quorumPeerConfig.parseProperties(properties); + + zkServer = new ZooKeeperServerMain(); + ServerConfig configuration = new ServerConfig(); + configuration.readFrom(quorumPeerConfig); + + zkServer.runFromConfig(configuration); + } catch (Exception e) { + if (errorHandler != null) { + errorHandler.handleError(e); + } else { + logger.error("Exception running embedded ZooKeeper", e); + } + } + } + } + +} diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java new file mode 100644 index 000000000..f1d9ae1c9 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -0,0 +1,42 @@ +/* + * 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.demo.provider.service; + +import com.alibaba.boot.dubbo.demo.consumer.DemoService; +import com.alibaba.dubbo.config.annotation.Service; + +import org.springframework.beans.factory.annotation.Value; + +/** + * Default {@link DemoService} + * + * @see DemoService + * @since 1.0.0 + */ +@Service(version = "${demo.service.version}") +public class DefaultDemoService implements DemoService { + + /** + * The default value of ${dubbo.application.name} is ${spring.application.name} + */ + @Value("${dubbo.application.name}") + private String serviceName; + + public String sayHello(String name) { + return String.format("[%s] : Hello, %s", serviceName, name); + } +} \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties new file mode 100644 index 000000000..30aa324ed --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties @@ -0,0 +1,22 @@ +# Spring boot application +spring.application.name=dubbo-registry-zookeeper-provider-sample + +# Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service +dubbo.scan.base-packages=com.alibaba.boot.dubbo.demo.provider.service + +# Dubbo Application +## The default value of dubbo.application.name is ${spring.application.name} +## dubbo.application.name=${spring.application.name} + +embedded.zookeeper.port = 2181 + +# Dubbo Protocol +dubbo.protocol.name=dubbo +## Random port +dubbo.protocol.port=-1 + +## Dubbo Registry +dubbo.registry.address=zookeeper://127.0.0.1:${embedded.zookeeper.port} + +## DemoService version +demo.service.version=1.0.0 \ No newline at end of file diff --git a/dubbo-spring-boot-samples/pom.xml b/dubbo-spring-boot-samples/pom.xml index 07be5f495..3a8a9be16 100644 --- a/dubbo-spring-boot-samples/pom.xml +++ b/dubbo-spring-boot-samples/pom.xml @@ -30,10 +30,13 @@ pom Dubbo Spring Boot Samples Dubbo Spring Boot Samples + sample-api auto-configure-samples externalized-configuration-samples + dubbo-registry-nacos-samples + dubbo-registry-zookeeper-samples From 84ae184b770401b62afb1d27a229aefef3b255ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Wed, 9 Jan 2019 08:54:24 +0800 Subject: [PATCH 07/46] 0.2.1 (#367) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 --- README.md | 2 +- README_CN.md | 2 +- dubbo-spring-boot-actuator/README.md | 2 +- dubbo-spring-boot-actuator/README_CN.md | 4 ++-- dubbo-spring-boot-actuator/pom.xml | 2 +- dubbo-spring-boot-autoconfigure/README.md | 2 +- dubbo-spring-boot-autoconfigure/pom.xml | 2 +- dubbo-spring-boot-parent/pom.xml | 2 +- .../auto-configure-samples/consumer-sample/pom.xml | 2 +- .../auto-configure-samples/pom.xml | 2 +- .../auto-configure-samples/provider-sample/pom.xml | 2 +- .../consumer-sample/pom.xml | 2 +- .../dubbo-registry-nacos-samples/pom.xml | 2 +- .../provider-sample/pom.xml | 2 +- .../consumer-sample/pom.xml | 2 +- .../dubbo-registry-zookeeper-samples/pom.xml | 2 +- .../provider-sample/pom.xml | 2 +- .../consumer-sample/pom.xml | 2 +- .../externalized-configuration-samples/pom.xml | 2 +- .../provider-sample/pom.xml | 2 +- dubbo-spring-boot-samples/pom.xml | 2 +- dubbo-spring-boot-samples/sample-api/pom.xml | 2 +- dubbo-spring-boot-starter/pom.xml | 2 +- pom.xml | 13 ++++++++----- 24 files changed, 32 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 34ca0d383..d24880f8e 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by addi com.alibaba.boot dubbo-spring-boot-starter - 0.2.1-SNAPSHOT + 0.2.1 com.alibaba diff --git a/README_CN.md b/README_CN.md index bdf584012..85a320d92 100644 --- a/README_CN.md +++ b/README_CN.md @@ -26,7 +26,7 @@ com.alibaba.boot dubbo-spring-boot-starter - 0.2.1-SNAPSHOT + 0.2.1 diff --git a/dubbo-spring-boot-actuator/README.md b/dubbo-spring-boot-actuator/README.md index 1410bca39..0b74034a7 100644 --- a/dubbo-spring-boot-actuator/README.md +++ b/dubbo-spring-boot-actuator/README.md @@ -33,7 +33,7 @@ You can introduce the latest `dubbo-spring-boot-actuator` to your project by ad com.alibaba.boot dubbo-spring-boot-actuator - 0.2.1-SNAPSHOT + 0.2.1 ``` 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 54db9ccc8..14a4103a7 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.2.1-SNAPSHOT + 0.2.1 com.alibaba.boot dubbo-spring-boot-actuator - 0.2.1-SNAPSHOT + 0.2.1 ... diff --git a/dubbo-spring-boot-actuator/pom.xml b/dubbo-spring-boot-actuator/pom.xml index 4e41bf245..644e5d2b7 100644 --- a/dubbo-spring-boot-actuator/pom.xml +++ b/dubbo-spring-boot-actuator/pom.xml @@ -20,7 +20,7 @@ dubbo-spring-boot-parent com.alibaba.boot - 0.2.1-SNAPSHOT + ${revision} ../dubbo-spring-boot-parent/pom.xml 4.0.0 diff --git a/dubbo-spring-boot-autoconfigure/README.md b/dubbo-spring-boot-autoconfigure/README.md index d75b8a1f4..0b461cec1 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.2.1-SNAPSHOT + 0.2.1 ``` diff --git a/dubbo-spring-boot-autoconfigure/pom.xml b/dubbo-spring-boot-autoconfigure/pom.xml index 6fb2ea3da..f9e933a4a 100644 --- a/dubbo-spring-boot-autoconfigure/pom.xml +++ b/dubbo-spring-boot-autoconfigure/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot dubbo-spring-boot-parent - 0.2.1-SNAPSHOT + ${revision} ../dubbo-spring-boot-parent/pom.xml 4.0.0 diff --git a/dubbo-spring-boot-parent/pom.xml b/dubbo-spring-boot-parent/pom.xml index 5b5d29eb1..d2f44ded3 100644 --- a/dubbo-spring-boot-parent/pom.xml +++ b/dubbo-spring-boot-parent/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot dubbo-spring-boot-project - 0.2.1-SNAPSHOT + ${revision} ../pom.xml diff --git a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml index 174159d63..1c1920ff6 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-auto-configure-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/auto-configure-samples/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/pom.xml index 3af94c34b..c9946947c 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/pom.xml +++ b/dubbo-spring-boot-samples/auto-configure-samples/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml index 75af9b506..8d8e32212 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-auto-configure-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml index 1da62fc53..2f11091ad 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-registry-nacos-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml index a9c399575..32e281652 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml index 899b26380..93740dbd5 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-registry-nacos-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml index cbf9b368c..375c27963 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-registry-zookeeper-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/pom.xml index a07218d68..f27101a2c 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml index eba5f196d..fb4690953 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-registry-zookeeper-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml index 3d4af183d..413eb9bf7 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-externalized-configuration-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml index b5298dfff..9bf23e9a6 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml index 7e2d9c705..4f90d8c3a 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-externalized-configuration-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/pom.xml b/dubbo-spring-boot-samples/pom.xml index 3a8a9be16..991c839b3 100644 --- a/dubbo-spring-boot-samples/pom.xml +++ b/dubbo-spring-boot-samples/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot dubbo-spring-boot-parent - 0.2.1-SNAPSHOT + ${revision} ../dubbo-spring-boot-parent/pom.xml 4.0.0 diff --git a/dubbo-spring-boot-samples/sample-api/pom.xml b/dubbo-spring-boot-samples/sample-api/pom.xml index f58e9760d..e6a6746db 100644 --- a/dubbo-spring-boot-samples/sample-api/pom.xml +++ b/dubbo-spring-boot-samples/sample-api/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot.samples dubbo-spring-boot-samples - 0.2.1-SNAPSHOT + ${revision} ../pom.xml 4.0.0 diff --git a/dubbo-spring-boot-starter/pom.xml b/dubbo-spring-boot-starter/pom.xml index f5e7dafed..2bd319a87 100644 --- a/dubbo-spring-boot-starter/pom.xml +++ b/dubbo-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.alibaba.boot dubbo-spring-boot-parent - 0.2.1-SNAPSHOT + ${revision} ../dubbo-spring-boot-parent 4.0.0 diff --git a/pom.xml b/pom.xml index a590d8091..566fffb21 100644 --- a/pom.xml +++ b/pom.xml @@ -23,13 +23,10 @@ oss-parent 7 - - 3.0.1 - 2.19.1 - + com.alibaba.boot dubbo-spring-boot-project - 0.2.1-SNAPSHOT + ${revision} pom @@ -37,6 +34,12 @@ Dubbo Spring Boot Project https://github.com/apache/incubator-dubbo-spring-boot-project + + 3.0.1 + 2.19.1 + 0.2.1 + + dubbo-spring-boot-parent dubbo-spring-boot-autoconfigure From 7ada7630bd541fd6780371219066052865a2642f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Wed, 9 Jan 2019 14:19:43 +0800 Subject: [PATCH 08/46] 0.2.1 (#372) (#374) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 --- .../assembly/bin-release.xml | 50 ++++++++ .../assembly/source-release.xml | 55 +++++++++ dubbo-spring-boot-distribution/pom.xml | 113 ++++++++++++++++++ pom.xml | 1 + 4 files changed, 219 insertions(+) create mode 100644 dubbo-spring-boot-distribution/assembly/bin-release.xml create mode 100644 dubbo-spring-boot-distribution/assembly/source-release.xml create mode 100644 dubbo-spring-boot-distribution/pom.xml diff --git a/dubbo-spring-boot-distribution/assembly/bin-release.xml b/dubbo-spring-boot-distribution/assembly/bin-release.xml new file mode 100644 index 000000000..1a9438174 --- /dev/null +++ b/dubbo-spring-boot-distribution/assembly/bin-release.xml @@ -0,0 +1,50 @@ + + + bin-release + + zip + + true + ${project.build.finalName}-bin-release + + + ../ + + DISCLAIMER + NOTICE + LICENSE + + + + + + + true + false + /libs + runtime + + com.alibaba.boot:* + + + com.alibaba:fastjson + + + + diff --git a/dubbo-spring-boot-distribution/assembly/source-release.xml b/dubbo-spring-boot-distribution/assembly/source-release.xml new file mode 100644 index 000000000..bbbec6151 --- /dev/null +++ b/dubbo-spring-boot-distribution/assembly/source-release.xml @@ -0,0 +1,55 @@ + + + source-release + + zip + + true + ${project.build.finalName}-source-release + + + + ../ + true + + **/* + + + **/target/** + **/build/** + **/eclipse-classes/** + *.enc + *.gpg + **/surefire* + **/svn-commit* + **/.idea/** + **/*.iml + **/*.ipr + **/*.iws + **/cobertura.ser + **/*.log + release.properties + **/*.xml.* + **/.mvn/** + **/*.jar + **/mvnw* + + + + diff --git a/dubbo-spring-boot-distribution/pom.xml b/dubbo-spring-boot-distribution/pom.xml new file mode 100644 index 000000000..89cb60b1b --- /dev/null +++ b/dubbo-spring-boot-distribution/pom.xml @@ -0,0 +1,113 @@ + + + + com.alibaba.boot + dubbo-spring-boot-parent + ${revision} + ../dubbo-spring-boot-parent/pom.xml + + 4.0.0 + + dubbo-spring-boot-distribution + pom + Dubbo Spring Boot Distribution + Dubbo Spring Boot Distribution + + + + + + ${project.groupId} + dubbo-spring-boot-actuator + ${project.version} + + + + ${project.groupId} + dubbo-spring-boot-autoconfigure + ${project.version} + + + + ${project.groupId} + dubbo-spring-boot-starter + ${project.version} + + + + + + + release + + apache-dubbo-spring-boot-project-${project.version} + + + maven-assembly-plugin + 3.1.0 + + + bin-release + package + + single + + + + assembly/bin-release.xml + + + + + source-release + package + + single + + + + assembly/source-release.xml + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 566fffb21..0f1dd4f89 100644 --- a/pom.xml +++ b/pom.xml @@ -42,6 +42,7 @@ dubbo-spring-boot-parent + dubbo-spring-boot-distribution dubbo-spring-boot-autoconfigure dubbo-spring-boot-starter dubbo-spring-boot-samples From 64095bc0996e500c125fbd97ccb114edd88592a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Wed, 9 Jan 2019 14:45:21 +0800 Subject: [PATCH 09/46] 0.2.1 (#378) * 0.2.1 (#372) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#376) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 --- dubbo-spring-boot-distribution/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-spring-boot-distribution/pom.xml b/dubbo-spring-boot-distribution/pom.xml index 89cb60b1b..377375b8a 100644 --- a/dubbo-spring-boot-distribution/pom.xml +++ b/dubbo-spring-boot-distribution/pom.xml @@ -57,7 +57,7 @@ release - apache-dubbo-spring-boot-project-${project.version} + apache-dubbo-spring-boot-project-incubating-${project.version} maven-assembly-plugin From 79e9fa899b74324a8e83d00aac10e3d899b8c3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Mon, 14 Jan 2019 17:54:52 +0800 Subject: [PATCH 10/46] 0.2.1 (#389) * 0.2.1 (#372) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#376) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#386) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * Add NOTICE and DISCLAIMER --- DISCLAIMER | 1 + NOTICE | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 DISCLAIMER create mode 100644 NOTICE diff --git a/DISCLAIMER b/DISCLAIMER new file mode 100644 index 000000000..bed312a0d --- /dev/null +++ b/DISCLAIMER @@ -0,0 +1 @@ +Apache Dubbo is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF. \ No newline at end of file diff --git a/NOTICE b/NOTICE new file mode 100644 index 000000000..97fefd076 --- /dev/null +++ b/NOTICE @@ -0,0 +1,14 @@ +Apache Dubbo (incubating) +Copyright 2018-2019 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +This product contains code form the Netty Project: + +The Netty Project +================= +Please visit the Netty web site for more information: + * http://netty.io/ + +Copyright 2014 The Netty Project \ No newline at end of file From ac98c7b4b4ebb0775f6d89ea327e9eb0e862ce49 Mon Sep 17 00:00:00 2001 From: Sun Zhiwu Date: Fri, 25 Jan 2019 16:53:47 +0800 Subject: [PATCH 11/46] Remove spring.providers file from starter module (#403) (#404) * remove spring.providers file since it's only used by STS IDE * deep search in project, no useage --- .../src/main/resources/META-INF/spring.provides | 1 - 1 file changed, 1 deletion(-) delete mode 100644 dubbo-spring-boot-starter/src/main/resources/META-INF/spring.provides diff --git a/dubbo-spring-boot-starter/src/main/resources/META-INF/spring.provides b/dubbo-spring-boot-starter/src/main/resources/META-INF/spring.provides deleted file mode 100644 index 5ea3fc3fe..000000000 --- a/dubbo-spring-boot-starter/src/main/resources/META-INF/spring.provides +++ /dev/null @@ -1 +0,0 @@ -provides: dubbo-spring-boot-autoconfigure,dubbo \ No newline at end of file From d7ff62314a3b2378b5628045384c6e71ab2298f0 Mon Sep 17 00:00:00 2001 From: Min-soo Date: Fri, 25 Jan 2019 17:53:58 +0900 Subject: [PATCH 12/46] add @Override annotation (#409) --- .../boot/dubbo/demo/provider/service/DefaultDemoService.java | 1 + .../boot/dubbo/demo/provider/service/DefaultDemoService.java | 1 + .../boot/dubbo/demo/provider/service/DefaultDemoService.java | 1 + .../boot/dubbo/demo/provider/service/DefaultDemoService.java | 1 + 4 files changed, 4 insertions(+) diff --git a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index 01dfccc3c..20fe66614 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -36,6 +36,7 @@ public class DefaultDemoService implements DemoService { @Value("${dubbo.application.name}") private String serviceName; + @Override public String sayHello(String name) { return String.format("[%s] : Hello, %s", serviceName, name); } diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index f1d9ae1c9..fcd3aa535 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -36,6 +36,7 @@ public class DefaultDemoService implements DemoService { @Value("${dubbo.application.name}") private String serviceName; + @Override public String sayHello(String name) { return String.format("[%s] : Hello, %s", serviceName, name); } diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index f1d9ae1c9..fcd3aa535 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -36,6 +36,7 @@ public class DefaultDemoService implements DemoService { @Value("${dubbo.application.name}") private String serviceName; + @Override public String sayHello(String name) { return String.format("[%s] : Hello, %s", serviceName, name); } diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index f1d9ae1c9..fcd3aa535 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -36,6 +36,7 @@ public class DefaultDemoService implements DemoService { @Value("${dubbo.application.name}") private String serviceName; + @Override public String sayHello(String name) { return String.format("[%s] : Hello, %s", serviceName, name); } From a02d6f160ee7f33b6477626a2972f8e513d5c041 Mon Sep 17 00:00:00 2001 From: Min-soo Date: Fri, 25 Jan 2019 17:54:10 +0900 Subject: [PATCH 13/46] to method reference (#410) * add @Override annotation * modify method reference --- .../bootstrap/DubboAutoConfigurationConsumerBootstrap.java | 4 +--- .../bootstrap/DubboRegistryNacosConsumerBootstrap.java | 4 +--- .../bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java | 4 +--- .../DubboExternalizedConfigurationConsumerBootstrap.java | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java index d84b96e4c..c83754ad7 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java +++ b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java @@ -41,9 +41,7 @@ public class DubboAutoConfigurationConsumerBootstrap { @Bean public ApplicationRunner runner() { - return args -> { - logger.info(demoService.sayHello("mercyblitz")); - }; + return args -> logger.info(demoService.sayHello("mercyblitz")); } public static void main(String[] args) { diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java index 408fe5e18..68b690fbb 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java @@ -39,9 +39,7 @@ public class DubboRegistryNacosConsumerBootstrap { @Bean public ApplicationRunner runner() { - return args -> { - logger.info(demoService.sayHello("mercyblitz")); - }; + return args -> logger.info(demoService.sayHello("mercyblitz")); } public static void main(String[] args) { diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java index 1b7935bb1..e2380286a 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java @@ -39,9 +39,7 @@ public class DubboRegistryZooKeeperConsumerBootstrap { @Bean public ApplicationRunner runner() { - return args -> { - logger.info(demoService.sayHello("mercyblitz")); - }; + return args -> logger.info(demoService.sayHello("mercyblitz")); } public static void main(String[] args) { diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java index 2eb78b432..2b3778d3f 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java @@ -39,9 +39,7 @@ public class DubboExternalizedConfigurationConsumerBootstrap { @Bean public ApplicationRunner runner() { - return args -> { - logger.info(demoService.sayHello("mercyblitz")); - }; + return args -> logger.info(demoService.sayHello("mercyblitz")); } public static void main(String[] args) { From e8f6b8fb0455176093710d57b4a6f38afcce5438 Mon Sep 17 00:00:00 2001 From: Mercy Ma Date: Sun, 27 Jan 2019 18:05:29 +0800 Subject: [PATCH 14/46] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e7afdadda..d76deb6c9 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by addi com.alibaba.boot dubbo-spring-boot-starter - 0.2.1-SNAPSHOT + 0.2.1 com.alibaba @@ -104,8 +104,8 @@ If you'd like to attempt to experience latest features, you also can build from | versions | Java | Spring Boot | Dubbo | | -------- | ----- | ----------- | ---------- | -| `0.2.1` | 1.8+ | `2.1.x` | `2.6.2` + | -| `0.1.1` | 1.7+ | `1.5.x` | `2.6.2` + | +| `0.2.1` | 1.8+ | `2.1.x` | `2.6.5` + | +| `0.1.1` | 1.7+ | `1.5.x` | `2.6.5` + | @@ -293,4 +293,4 @@ The samples project of Dubbo Spring Boot that includes: - [Externalized Configuration Samples](dubbo-spring-boot-samples/externalized-configuration-samples) - [Registry Zookeeper Samples](dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples) - [Registry Nacos Samples](dubbo-spring-boot-samples/dubbo-registry-nacos-samples) -- [Sample API](dubbo-spring-boot-samples/sample-api) \ No newline at end of file +- [Sample API](dubbo-spring-boot-samples/sample-api) From 5adb2d81b55f647c939a5a6b46fb91a35c501d71 Mon Sep 17 00:00:00 2001 From: Mercy Ma Date: Sun, 27 Jan 2019 18:06:53 +0800 Subject: [PATCH 15/46] Update README_CN.md --- README_CN.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README_CN.md b/README_CN.md index aa50001fe..e890d2532 100644 --- a/README_CN.md +++ b/README_CN.md @@ -78,10 +78,10 @@ ### 依赖关系 -| 版本 | Java | Spring Boot | Dubbo | -| -------- | ----- | ----------------- | ---------- | -| `0.2.0` | 1.8+ | `2.0.x` | `2.6.2`+ | -| `0.1.1` | 1.7+ | `1.5.x` | `2.6.2`+ | +| versions | Java | Spring Boot | Dubbo | +| -------- | ----- | ----------- | ---------- | +| `0.2.1` | 1.8+ | `2.1.x` | `2.6.5` + | +| `0.1.1` | 1.7+ | `1.5.x` | `2.6.5` + | From b03d00634e0e6bfea421389935a3094a0e8ffcdf Mon Sep 17 00:00:00 2001 From: Mercy Ma Date: Sun, 27 Jan 2019 18:13:14 +0800 Subject: [PATCH 16/46] Update README_CN.md --- README_CN.md | 89 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 36 deletions(-) diff --git a/README_CN.md b/README_CN.md index e890d2532..7451ae404 100644 --- a/README_CN.md +++ b/README_CN.md @@ -23,24 +23,50 @@ 您可以为您的工程引入最新 `dubbo-spring-boot-starter` 的发布,增加以下依赖到工程的 `pom.xml` 文件中: ```xml - - com.alibaba.boot - dubbo-spring-boot-starter - 0.2.1 - - - - - com.alibaba - dubbo - 2.6.5 - - - - com.alibaba.spring - spring-context-support - 1.0.2 - + + 2.1.1.RELEASE + 2.6.5 + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + com.alibaba + dubbo-dependencies-bom + ${dubbo.version} + pom + import + + + + + + + + com.alibaba.boot + dubbo-spring-boot-starter + 0.2.1 + + + com.alibaba + dubbo + ${dubbo.version} + + + io.netty + netty-all + + ``` 如果您的工程遇到了依赖问题, 请尝试添加如下 Maven 参考到工程的 `pom.xml` 文件中: @@ -251,9 +277,9 @@ dubbo.protocol.port = 12345 如果您在使用 Dubbo Spring Boot 中遇到任何问题或者有什么建议? 我们非常需要您的支持! -- 如果您需要升级版本,请提前阅读[发布公告](https://github.com/dubbo/dubbo-spring-boot-project/releases),了解最新的特性和问题修复。 -- 如果您遇到任何问题 ,您可以加入官方 [Google 讨论组](https://groups.google.com/group/dubbo) , 或者订阅 [Dubbo 用户邮件列表](mailto:dubbo+subscribe@googlegroups.com)。 -- 问题反馈,您可以在 [issues](https://github.com/dubbo/dubbo-spring-boot-project/issues) 提出您遇到的使用问题。 +- 如果您需要升级版本,请提前阅读[发布公告](https://github.com/apache/incubator-dubbo-spring-boot-project/releases),了解最新的特性和问题修复。 +- 如果您遇到任何问题 ,您可以订阅 [Dubbo 用户邮件列表](mailto:mailto:dev-subscribe@dubbo.apache.org)。 +- 问题反馈,您可以在 [issues](https://github.com/apache/incubator-dubbo-spring-boot-project/issues) 提出您遇到的使用问题。 @@ -290,19 +316,10 @@ Dubbo Spring Boot 采用多 Maven 模块工程 , 模块如下: ### [dubbo-spring-boot-samples](dubbo-spring-boot-samples) -The samples project of Dubbo Spring Boot that includes two parts: -[dubbo-spring-boot-samples](dubbo-spring-boot-samples) 为 Dubbo Spring Boot 示例工程,包括: +示例工程包含以下项目: - -#### [Dubbo 服务提供方示例](dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider) - -Dubbo 服务将会通过 localhost 的 `12345` 端口暴露服务,并且提供 JMX Endpoints。 - - -#### [Dubbo 服务消费方示例](dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer) - -Dubbo 服务将被 Spring WebMVC `Controller` 消费,并且提供 JMX 以及 Web Endpoints 端口: - -* 示例 `Controller` : http://localhost:8080/sayHello?name=HelloWorld -* [健康检查](dubbo-spring-boot-actuator#health-checks) : http://localhost:8081/actuator/health -* [Dubbo Endpoints](dubbo-spring-boot-actuator#endpoints) : http://localhost:8081/actuator/dubbo +- [自动装配示例](dubbo-spring-boot-samples/auto-configure-samples) +- [外部化示例](dubbo-spring-boot-samples/externalized-configuration-samples) +- [整合 Zookeeper 示例](dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples) +- [整合 Nacos 示例](dubbo-spring-boot-samples/dubbo-registry-nacos-samples) +- [示例 API](dubbo-spring-boot-samples/sample-api) From 9f5024db6f99dea50a830261b53bfb66c0d1c487 Mon Sep 17 00:00:00 2001 From: Mercy Ma Date: Sun, 27 Jan 2019 18:13:16 +0800 Subject: [PATCH 17/46] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d76deb6c9..0e03ca540 100644 --- a/README.md +++ b/README.md @@ -238,9 +238,9 @@ More details, please refer to [Samples](dubbo-spring-boot-samples). Having trouble with Dubbo Spring Boot? We’d like to help! -- If you are upgrading, read the [release notes](https://github.com/dubbo/dubbo-spring-boot-project/releases) for upgrade instructions and "new and noteworthy" features. -- Ask a question - You can join [ours google groups](https://groups.google.com/group/dubbo), or subscribe [Dubbo User Mailling List](mailto:dubbo+subscribe@googlegroups.com). -- Report bugs at [github.com/dubbo/dubbo-spring-boot-project/issues](https://github.com/dubbo/dubbo-spring-boot-project/issues). +- If you are upgrading, read the [release notes](https://github.com/apache/incubator-dubbo-spring-boot-project/releases) for upgrade instructions and "new and noteworthy" features. +- Ask a question - You can subscribe [Dubbo User Mailling List](mailto:dev-subscribe@dubbo.apache.org). +- Report bugs at [issues](https://github.com/apache/incubator-dubbo-spring-boot-project/issues). From 73ad6b9f8354eed237dcf125a3fdace0d3d063b8 Mon Sep 17 00:00:00 2001 From: Mercy Ma Date: Sun, 27 Jan 2019 20:54:15 +0800 Subject: [PATCH 18/46] Sync master to 0.2.x (#417) * 0.2.1 release (#402) * 0.2.1 (#345) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * 0.2.1 (#346) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * 0.2.1 (#357) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * 0.2.1 (#360) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * 0.2.1 (#367) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * 0.2.1 (#372) (#374) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#378) * 0.2.1 (#372) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#376) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#389) * 0.2.1 (#372) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#376) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#386) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * Add NOTICE and DISCLAIMER * Add Java11 support #383 (#393) * Upgrade jacoco to version 0.8.2 #383 * Update travis setting add openjdk11 remove openjdk10 openjdk9 * Update mailing list address (#380) * Update README [user guide] link (#348) * Remove spring.providers file from starter module (#403) (#404) * remove spring.providers file since it's only used by STS IDE * deep search in project, no useage * add @Override annotation (#409) * to method reference (#410) * add @Override annotation * modify method reference * Update README.md * Update README_CN.md * Update README_CN.md * Update README.md --- .travis.yml | 3 +- README.md | 16 +-- README_CN.md | 99 +++++++++++-------- .../actuate/endpoint/DubboEndpointTest.java | 2 +- .../alibaba/boot/dubbo/util/DubboUtils.java | 2 +- .../boot/dubbo/util/DubboUtilsTest.java | 2 +- dubbo-spring-boot-parent/pom.xml | 2 +- ...bboAutoConfigurationConsumerBootstrap.java | 4 +- .../provider/service/DefaultDemoService.java | 1 + .../DubboRegistryNacosConsumerBootstrap.java | 4 +- .../provider/service/DefaultDemoService.java | 1 + ...bboRegistryZooKeeperConsumerBootstrap.java | 4 +- .../provider/service/DefaultDemoService.java | 1 + ...nalizedConfigurationConsumerBootstrap.java | 4 +- .../provider/service/DefaultDemoService.java | 1 + .../main/resources/META-INF/spring.provides | 1 - 16 files changed, 79 insertions(+), 68 deletions(-) delete mode 100644 dubbo-spring-boot-starter/src/main/resources/META-INF/spring.provides diff --git a/.travis.yml b/.travis.yml index 71e20320e..041395bdd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,7 @@ language: java sudo: false # faster builds jdk: - - openjdk10 - - openjdk9 + - openjdk11 - oraclejdk8 script: "mvn clean package" diff --git a/README.md b/README.md index 34ca0d383..0e03ca540 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by addi com.alibaba.boot dubbo-spring-boot-starter - 0.2.1-SNAPSHOT + 0.2.1 com.alibaba @@ -104,14 +104,14 @@ If you'd like to attempt to experience latest features, you also can build from | versions | Java | Spring Boot | Dubbo | | -------- | ----- | ----------- | ---------- | -| `0.2.1` | 1.8+ | `2.1.x` | `2.6.2` + | -| `0.1.1` | 1.7+ | `1.5.x` | `2.6.2` + | +| `0.2.1` | 1.8+ | `2.1.x` | `2.6.5` + | +| `0.1.1` | 1.7+ | `1.5.x` | `2.6.5` + | ## Getting Started -If you don't know about Dubbo, please take a few minutes to learn http://dubbo.apache.org/. After that you could dive deep into dubbo [user guide](http://dubbo.apache.org/books/dubbo-user-book-en/). +If you don't know about Dubbo, please take a few minutes to learn http://dubbo.apache.org/. After that you could dive deep into dubbo [user guide](http://dubbo.apache.org/en-us/docs/user/quick-start.html). Usually, There are two usage scenarios for Dubbo applications, one is Dubbo service(s) provider, another is Dubbo service(s) consumer, thus let's get a quick start on them. @@ -238,9 +238,9 @@ More details, please refer to [Samples](dubbo-spring-boot-samples). Having trouble with Dubbo Spring Boot? We’d like to help! -- If you are upgrading, read the [release notes](https://github.com/dubbo/dubbo-spring-boot-project/releases) for upgrade instructions and "new and noteworthy" features. -- Ask a question - You can join [ours google groups](https://groups.google.com/group/dubbo), or subscribe [Dubbo User Mailling List](mailto:dubbo+subscribe@googlegroups.com). -- Report bugs at [github.com/dubbo/dubbo-spring-boot-project/issues](https://github.com/dubbo/dubbo-spring-boot-project/issues). +- If you are upgrading, read the [release notes](https://github.com/apache/incubator-dubbo-spring-boot-project/releases) for upgrade instructions and "new and noteworthy" features. +- Ask a question - You can subscribe [Dubbo User Mailling List](mailto:dev-subscribe@dubbo.apache.org). +- Report bugs at [issues](https://github.com/apache/incubator-dubbo-spring-boot-project/issues). @@ -293,4 +293,4 @@ The samples project of Dubbo Spring Boot that includes: - [Externalized Configuration Samples](dubbo-spring-boot-samples/externalized-configuration-samples) - [Registry Zookeeper Samples](dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples) - [Registry Nacos Samples](dubbo-spring-boot-samples/dubbo-registry-nacos-samples) -- [Sample API](dubbo-spring-boot-samples/sample-api) \ No newline at end of file +- [Sample API](dubbo-spring-boot-samples/sample-api) diff --git a/README_CN.md b/README_CN.md index 85a320d92..7451ae404 100644 --- a/README_CN.md +++ b/README_CN.md @@ -23,24 +23,50 @@ 您可以为您的工程引入最新 `dubbo-spring-boot-starter` 的发布,增加以下依赖到工程的 `pom.xml` 文件中: ```xml - - com.alibaba.boot - dubbo-spring-boot-starter - 0.2.1 - - - - - com.alibaba - dubbo - 2.6.5 - - - - com.alibaba.spring - spring-context-support - 1.0.2 - + + 2.1.1.RELEASE + 2.6.5 + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + com.alibaba + dubbo-dependencies-bom + ${dubbo.version} + pom + import + + + + + + + + com.alibaba.boot + dubbo-spring-boot-starter + 0.2.1 + + + com.alibaba + dubbo + ${dubbo.version} + + + io.netty + netty-all + + ``` 如果您的工程遇到了依赖问题, 请尝试添加如下 Maven 参考到工程的 `pom.xml` 文件中: @@ -78,16 +104,16 @@ ### 依赖关系 -| 版本 | Java | Spring Boot | Dubbo | -| -------- | ----- | ----------------- | ---------- | -| `0.2.0` | 1.8+ | `2.0.x` | `2.6.2`+ | -| `0.1.1` | 1.7+ | `1.5.x` | `2.6.2`+ | +| versions | Java | Spring Boot | Dubbo | +| -------- | ----- | ----------- | ---------- | +| `0.2.1` | 1.8+ | `2.1.x` | `2.6.5` + | +| `0.1.1` | 1.7+ | `1.5.x` | `2.6.5` + | ## 快速开始 -如果您对 Dubbo 不是非常了解,耽误您几分钟访问 http://dubbo.apache.org/ 。了解后,如果你期望更深入的探讨,可以移步[用户手册](http://dubbo.apache.org/books/dubbo-user-book/)。 +如果您对 Dubbo 不是非常了解,耽误您几分钟访问 http://dubbo.apache.org/ 。了解后,如果你期望更深入的探讨,可以移步[用户手册](http://dubbo.apache.org/zh-cn/docs/user/quick-start.html)。 通常情况 , Dubbo 应用有两种使用场景 , 其一为 Dubbo 服务提供方 , 另外一个是 Dubbo 服务消费方,当然也允许两者混合,下面我们一起快速开始! @@ -251,9 +277,9 @@ dubbo.protocol.port = 12345 如果您在使用 Dubbo Spring Boot 中遇到任何问题或者有什么建议? 我们非常需要您的支持! -- 如果您需要升级版本,请提前阅读[发布公告](https://github.com/dubbo/dubbo-spring-boot-project/releases),了解最新的特性和问题修复。 -- 如果您遇到任何问题 ,您可以加入官方 [Google 讨论组](https://groups.google.com/group/dubbo) , 或者订阅 [Dubbo 用户邮件列表](mailto:dubbo+subscribe@googlegroups.com)。 -- 问题反馈,您可以在 [issues](https://github.com/dubbo/dubbo-spring-boot-project/issues) 提出您遇到的使用问题。 +- 如果您需要升级版本,请提前阅读[发布公告](https://github.com/apache/incubator-dubbo-spring-boot-project/releases),了解最新的特性和问题修复。 +- 如果您遇到任何问题 ,您可以订阅 [Dubbo 用户邮件列表](mailto:mailto:dev-subscribe@dubbo.apache.org)。 +- 问题反馈,您可以在 [issues](https://github.com/apache/incubator-dubbo-spring-boot-project/issues) 提出您遇到的使用问题。 @@ -290,19 +316,10 @@ Dubbo Spring Boot 采用多 Maven 模块工程 , 模块如下: ### [dubbo-spring-boot-samples](dubbo-spring-boot-samples) -The samples project of Dubbo Spring Boot that includes two parts: -[dubbo-spring-boot-samples](dubbo-spring-boot-samples) 为 Dubbo Spring Boot 示例工程,包括: +示例工程包含以下项目: - -#### [Dubbo 服务提供方示例](dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider) - -Dubbo 服务将会通过 localhost 的 `12345` 端口暴露服务,并且提供 JMX Endpoints。 - - -#### [Dubbo 服务消费方示例](dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer) - -Dubbo 服务将被 Spring WebMVC `Controller` 消费,并且提供 JMX 以及 Web Endpoints 端口: - -* 示例 `Controller` : http://localhost:8080/sayHello?name=HelloWorld -* [健康检查](dubbo-spring-boot-actuator#health-checks) : http://localhost:8081/actuator/health -* [Dubbo Endpoints](dubbo-spring-boot-actuator#endpoints) : http://localhost:8081/actuator/dubbo +- [自动装配示例](dubbo-spring-boot-samples/auto-configure-samples) +- [外部化示例](dubbo-spring-boot-samples/externalized-configuration-samples) +- [整合 Zookeeper 示例](dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples) +- [整合 Nacos 示例](dubbo-spring-boot-samples/dubbo-registry-nacos-samples) +- [示例 API](dubbo-spring-boot-samples/sample-api) 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 ac2b04936..0cdfb2144 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 @@ -65,7 +65,7 @@ public void testInvoke() { Assert.assertEquals(getVersion(), versions.get("dubbo")); Assert.assertEquals("https://github.com/apache/incubator-dubbo", urls.get("dubbo")); - Assert.assertEquals("dev@dubbo.incubator.apache.org", urls.get("mailing-list")); + Assert.assertEquals("dev@dubbo.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-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 76ee68963..59cde995f 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 @@ -111,7 +111,7 @@ public abstract class DubboUtils { /** * The google group URL of Dubbo */ - public static final String DUBBO_MAILING_LIST = "dev@dubbo.incubator.apache.org"; + public static final String DUBBO_MAILING_LIST = "dev@dubbo.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 066cce5a2..c972dc863 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 @@ -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_MAILING_LIST); + Assert.assertEquals("dev@dubbo.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 d2f44ded3..c583e0f02 100644 --- a/dubbo-spring-boot-parent/pom.xml +++ b/dubbo-spring-boot-parent/pom.xml @@ -51,7 +51,7 @@ 3.0.2 3.6.0 3.0.1 - 0.8.1 + 0.8.2 1.5 0.12 2.5.3 diff --git a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java index d84b96e4c..c83754ad7 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java +++ b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java @@ -41,9 +41,7 @@ public class DubboAutoConfigurationConsumerBootstrap { @Bean public ApplicationRunner runner() { - return args -> { - logger.info(demoService.sayHello("mercyblitz")); - }; + return args -> logger.info(demoService.sayHello("mercyblitz")); } public static void main(String[] args) { diff --git a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index 01dfccc3c..20fe66614 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -36,6 +36,7 @@ public class DefaultDemoService implements DemoService { @Value("${dubbo.application.name}") private String serviceName; + @Override public String sayHello(String name) { return String.format("[%s] : Hello, %s", serviceName, name); } diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java index 408fe5e18..68b690fbb 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java @@ -39,9 +39,7 @@ public class DubboRegistryNacosConsumerBootstrap { @Bean public ApplicationRunner runner() { - return args -> { - logger.info(demoService.sayHello("mercyblitz")); - }; + return args -> logger.info(demoService.sayHello("mercyblitz")); } public static void main(String[] args) { diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index f1d9ae1c9..fcd3aa535 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -36,6 +36,7 @@ public class DefaultDemoService implements DemoService { @Value("${dubbo.application.name}") private String serviceName; + @Override public String sayHello(String name) { return String.format("[%s] : Hello, %s", serviceName, name); } diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java index 1b7935bb1..e2380286a 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java @@ -39,9 +39,7 @@ public class DubboRegistryZooKeeperConsumerBootstrap { @Bean public ApplicationRunner runner() { - return args -> { - logger.info(demoService.sayHello("mercyblitz")); - }; + return args -> logger.info(demoService.sayHello("mercyblitz")); } public static void main(String[] args) { diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index f1d9ae1c9..fcd3aa535 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -36,6 +36,7 @@ public class DefaultDemoService implements DemoService { @Value("${dubbo.application.name}") private String serviceName; + @Override public String sayHello(String name) { return String.format("[%s] : Hello, %s", serviceName, name); } diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java index 2eb78b432..2b3778d3f 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/com/alibaba/boot/dubbo/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java @@ -39,9 +39,7 @@ public class DubboExternalizedConfigurationConsumerBootstrap { @Bean public ApplicationRunner runner() { - return args -> { - logger.info(demoService.sayHello("mercyblitz")); - }; + return args -> logger.info(demoService.sayHello("mercyblitz")); } public static void main(String[] args) { diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index f1d9ae1c9..fcd3aa535 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -36,6 +36,7 @@ public class DefaultDemoService implements DemoService { @Value("${dubbo.application.name}") private String serviceName; + @Override public String sayHello(String name) { return String.format("[%s] : Hello, %s", serviceName, name); } diff --git a/dubbo-spring-boot-starter/src/main/resources/META-INF/spring.provides b/dubbo-spring-boot-starter/src/main/resources/META-INF/spring.provides deleted file mode 100644 index 5ea3fc3fe..000000000 --- a/dubbo-spring-boot-starter/src/main/resources/META-INF/spring.provides +++ /dev/null @@ -1 +0,0 @@ -provides: dubbo-spring-boot-autoconfigure,dubbo \ No newline at end of file From 30154b5630c2d9a5b76cc8e45fbd7047686f4060 Mon Sep 17 00:00:00 2001 From: Mercy Ma Date: Mon, 28 Jan 2019 15:12:57 +0800 Subject: [PATCH 19/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e03ca540..5b16bfab7 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by addi com.alibaba.boot - dubbo-spring-boot-starter + dubbo-spring-boot-autoconfigure 0.2.1 From c98f3713d35b57ab3af95b00ee4284f6c096fc8f Mon Sep 17 00:00:00 2001 From: Mercy Ma Date: Mon, 28 Jan 2019 15:13:22 +0800 Subject: [PATCH 20/46] Update README_CN.md --- README_CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index 7451ae404..0f31abec9 100644 --- a/README_CN.md +++ b/README_CN.md @@ -54,7 +54,7 @@ com.alibaba.boot - dubbo-spring-boot-starter + dubbo-spring-boot-autoconfigure 0.2.1 From d89ef990a54f67ca77880c3379c57e7a34f84c59 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 29 Jan 2019 16:01:21 +0800 Subject: [PATCH 21/46] Replace ${project.version} to ${revision} in the "pom.xml" files --- .gitignore | 5 +++- dubbo-spring-boot-actuator/pom.xml | 2 +- dubbo-spring-boot-distribution/pom.xml | 6 ++-- .../consumer-sample/pom.xml | 4 +-- .../provider-sample/pom.xml | 4 +-- .../consumer-sample/pom.xml | 4 +-- .../provider-sample/pom.xml | 4 +-- .../consumer-sample/pom.xml | 4 +-- .../provider-sample/pom.xml | 4 +-- .../consumer-sample/pom.xml | 4 +-- .../provider-sample/pom.xml | 4 +-- dubbo-spring-boot-starter/pom.xml | 2 +- pom.xml | 28 +++++++++++++++++++ 13 files changed, 53 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 35e3edecc..8f36fdad1 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,7 @@ target # system ignore .DS_Store -Thumbs.db \ No newline at end of file +Thumbs.db + +# Maven ignore +.flattened-pom.xml \ No newline at end of file diff --git a/dubbo-spring-boot-actuator/pom.xml b/dubbo-spring-boot-actuator/pom.xml index 644e5d2b7..f78b95afe 100644 --- a/dubbo-spring-boot-actuator/pom.xml +++ b/dubbo-spring-boot-actuator/pom.xml @@ -61,7 +61,7 @@ ${project.groupId} dubbo-spring-boot-autoconfigure - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-distribution/pom.xml b/dubbo-spring-boot-distribution/pom.xml index 377375b8a..6ffa3ee12 100644 --- a/dubbo-spring-boot-distribution/pom.xml +++ b/dubbo-spring-boot-distribution/pom.xml @@ -36,19 +36,19 @@ ${project.groupId} dubbo-spring-boot-actuator - ${project.version} + ${revision} ${project.groupId} dubbo-spring-boot-autoconfigure - ${project.version} + ${revision} ${project.groupId} dubbo-spring-boot-starter - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml index 1c1920ff6..4ce402112 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml @@ -38,7 +38,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -49,7 +49,7 @@ ${project.groupId} dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml index 8d8e32212..ad973678a 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml @@ -39,7 +39,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -50,7 +50,7 @@ ${project.groupId} dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml index 2f11091ad..d0578fb8b 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml @@ -38,7 +38,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -50,7 +50,7 @@ ${project.groupId} dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml index 93740dbd5..13d1a1ff8 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml @@ -39,7 +39,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -51,7 +51,7 @@ ${project.groupId} dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml index 375c27963..73adeed5f 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml @@ -38,7 +38,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -49,7 +49,7 @@ ${project.groupId} dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml index fb4690953..f6828a992 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml @@ -39,7 +39,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -51,7 +51,7 @@ ${project.groupId} dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml index 413eb9bf7..3e4cd26c7 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml @@ -38,7 +38,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -49,7 +49,7 @@ ${project.groupId} dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml index 4f90d8c3a..37cb3b551 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml @@ -39,7 +39,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -50,7 +50,7 @@ ${project.groupId} dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-starter/pom.xml b/dubbo-spring-boot-starter/pom.xml index 2bd319a87..92f5c7ee5 100644 --- a/dubbo-spring-boot-starter/pom.xml +++ b/dubbo-spring-boot-starter/pom.xml @@ -55,7 +55,7 @@ com.alibaba.boot dubbo-spring-boot-autoconfigure - ${project.version} + ${revision} diff --git a/pom.xml b/pom.xml index 0f1dd4f89..a223d607b 100644 --- a/pom.xml +++ b/pom.xml @@ -112,6 +112,7 @@ + org.apache.maven.plugins maven-gpg-plugin @@ -124,6 +125,33 @@ + + + org.codehaus.mojo + flatten-maven-plugin + 1.1.0 + + true + resolveCiFriendliesOnly + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + + From 3de5a51d4035df47e6a3776c5d16754000b7f345 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 29 Jan 2019 16:17:06 +0800 Subject: [PATCH 22/46] Update --- dubbo-spring-boot-actuator/pom.xml | 2 +- dubbo-spring-boot-distribution/pom.xml | 6 +++--- .../auto-configure-samples/consumer-sample/pom.xml | 2 +- .../auto-configure-samples/provider-sample/pom.xml | 2 +- .../dubbo-registry-nacos-samples/consumer-sample/pom.xml | 2 +- .../dubbo-registry-nacos-samples/provider-sample/pom.xml | 2 +- .../consumer-sample/pom.xml | 2 +- .../provider-sample/pom.xml | 2 +- .../consumer-sample/pom.xml | 2 +- .../provider-sample/pom.xml | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dubbo-spring-boot-actuator/pom.xml b/dubbo-spring-boot-actuator/pom.xml index f78b95afe..8359cb920 100644 --- a/dubbo-spring-boot-actuator/pom.xml +++ b/dubbo-spring-boot-actuator/pom.xml @@ -59,7 +59,7 @@ - ${project.groupId} + com.alibaba.boot dubbo-spring-boot-autoconfigure ${revision} diff --git a/dubbo-spring-boot-distribution/pom.xml b/dubbo-spring-boot-distribution/pom.xml index 6ffa3ee12..9f7e21ff9 100644 --- a/dubbo-spring-boot-distribution/pom.xml +++ b/dubbo-spring-boot-distribution/pom.xml @@ -34,19 +34,19 @@ - ${project.groupId} + com.alibaba.boot dubbo-spring-boot-actuator ${revision} - ${project.groupId} + com.alibaba.boot dubbo-spring-boot-autoconfigure ${revision} - ${project.groupId} + com.alibaba.boot dubbo-spring-boot-starter ${revision} diff --git a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml index 4ce402112..ee6a6ff74 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml @@ -47,7 +47,7 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api ${revision} diff --git a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml index ad973678a..aee1aa972 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml @@ -48,7 +48,7 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api ${revision} diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml index d0578fb8b..87d4af92b 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml @@ -48,7 +48,7 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api ${revision} diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml index 13d1a1ff8..339a2e641 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml @@ -49,7 +49,7 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api ${revision} diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml index 73adeed5f..c51685cd6 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml @@ -47,7 +47,7 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api ${revision} diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml index f6828a992..24088b95e 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml @@ -49,7 +49,7 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api ${revision} diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml index 3e4cd26c7..97fb10aa6 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml @@ -47,7 +47,7 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api ${revision} diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml index 37cb3b551..093787ae3 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml @@ -48,7 +48,7 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api ${revision} From 2dc44c93411a3db0aa0cf1987143c2fb3a3bdc71 Mon Sep 17 00:00:00 2001 From: Mercy Ma Date: Wed, 30 Jan 2019 06:42:33 +0800 Subject: [PATCH 23/46] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5b16bfab7..be16c2638 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,8 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by addi com.alibaba.boot - dubbo-spring-boot-autoconfigure - 0.2.1 + dubbo-spring-boot-starter + 0.2.1.RELEASE com.alibaba From b77a096670b57b3fce8a3f07a09660c8e02f558d Mon Sep 17 00:00:00 2001 From: Mercy Ma Date: Wed, 30 Jan 2019 06:42:55 +0800 Subject: [PATCH 24/46] Update README_CN.md --- README_CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_CN.md b/README_CN.md index 0f31abec9..bccd60c92 100644 --- a/README_CN.md +++ b/README_CN.md @@ -54,8 +54,8 @@ com.alibaba.boot - dubbo-spring-boot-autoconfigure - 0.2.1 + dubbo-spring-boot-starter + 0.2.1.RELEASE com.alibaba From 9729fa669b4c46483ea6c27c8cd1656df46307f0 Mon Sep 17 00:00:00 2001 From: Mercy Ma Date: Wed, 30 Jan 2019 09:29:44 +0800 Subject: [PATCH 25/46] 0.2.x (#422) * Sync master to 0.2.x (#417) * 0.2.1 release (#402) * 0.2.1 (#345) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * 0.2.1 (#346) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * 0.2.1 (#357) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * 0.2.1 (#360) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * 0.2.1 (#367) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * 0.2.1 (#372) (#374) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#378) * 0.2.1 (#372) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#376) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#389) * 0.2.1 (#372) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#376) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#386) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * Add NOTICE and DISCLAIMER * Add Java11 support #383 (#393) * Upgrade jacoco to version 0.8.2 #383 * Update travis setting add openjdk11 remove openjdk10 openjdk9 * Update mailing list address (#380) * Update README [user guide] link (#348) * Remove spring.providers file from starter module (#403) (#404) * remove spring.providers file since it's only used by STS IDE * deep search in project, no useage * add @Override annotation (#409) * to method reference (#410) * add @Override annotation * modify method reference * Update README.md * Update README_CN.md * Update README_CN.md * Update README.md * Replace ${project.version} to ${revision} in the "pom.xml" files * Update --- .gitignore | 5 +++- dubbo-spring-boot-actuator/pom.xml | 4 +-- dubbo-spring-boot-distribution/pom.xml | 12 ++++---- .../consumer-sample/pom.xml | 6 ++-- .../provider-sample/pom.xml | 6 ++-- .../consumer-sample/pom.xml | 6 ++-- .../provider-sample/pom.xml | 6 ++-- .../consumer-sample/pom.xml | 6 ++-- .../provider-sample/pom.xml | 6 ++-- .../consumer-sample/pom.xml | 6 ++-- .../provider-sample/pom.xml | 6 ++-- dubbo-spring-boot-starter/pom.xml | 2 +- pom.xml | 28 +++++++++++++++++++ 13 files changed, 65 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index 35e3edecc..8f36fdad1 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,7 @@ target # system ignore .DS_Store -Thumbs.db \ No newline at end of file +Thumbs.db + +# Maven ignore +.flattened-pom.xml \ No newline at end of file diff --git a/dubbo-spring-boot-actuator/pom.xml b/dubbo-spring-boot-actuator/pom.xml index 644e5d2b7..8359cb920 100644 --- a/dubbo-spring-boot-actuator/pom.xml +++ b/dubbo-spring-boot-actuator/pom.xml @@ -59,9 +59,9 @@ - ${project.groupId} + com.alibaba.boot dubbo-spring-boot-autoconfigure - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-distribution/pom.xml b/dubbo-spring-boot-distribution/pom.xml index 377375b8a..9f7e21ff9 100644 --- a/dubbo-spring-boot-distribution/pom.xml +++ b/dubbo-spring-boot-distribution/pom.xml @@ -34,21 +34,21 @@ - ${project.groupId} + com.alibaba.boot dubbo-spring-boot-actuator - ${project.version} + ${revision} - ${project.groupId} + com.alibaba.boot dubbo-spring-boot-autoconfigure - ${project.version} + ${revision} - ${project.groupId} + com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml index 1c1920ff6..ee6a6ff74 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/pom.xml @@ -38,7 +38,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -47,9 +47,9 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml index 8d8e32212..aee1aa972 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml @@ -39,7 +39,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -48,9 +48,9 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml index 2f11091ad..87d4af92b 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml @@ -38,7 +38,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -48,9 +48,9 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml index 93740dbd5..339a2e641 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml @@ -39,7 +39,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -49,9 +49,9 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml index 375c27963..c51685cd6 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml @@ -38,7 +38,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -47,9 +47,9 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml index fb4690953..24088b95e 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml @@ -39,7 +39,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -49,9 +49,9 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml index 413eb9bf7..97fb10aa6 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml @@ -38,7 +38,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -47,9 +47,9 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml index 4f90d8c3a..093787ae3 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml @@ -39,7 +39,7 @@ com.alibaba.boot dubbo-spring-boot-starter - ${project.version} + ${revision} @@ -48,9 +48,9 @@ - ${project.groupId} + com.alibaba.boot.samples dubbo-spring-boot-sample-api - ${project.version} + ${revision} diff --git a/dubbo-spring-boot-starter/pom.xml b/dubbo-spring-boot-starter/pom.xml index 2bd319a87..92f5c7ee5 100644 --- a/dubbo-spring-boot-starter/pom.xml +++ b/dubbo-spring-boot-starter/pom.xml @@ -55,7 +55,7 @@ com.alibaba.boot dubbo-spring-boot-autoconfigure - ${project.version} + ${revision} diff --git a/pom.xml b/pom.xml index 0f1dd4f89..a223d607b 100644 --- a/pom.xml +++ b/pom.xml @@ -112,6 +112,7 @@ + org.apache.maven.plugins maven-gpg-plugin @@ -124,6 +125,33 @@ + + + org.codehaus.mojo + flatten-maven-plugin + 1.1.0 + + true + resolveCiFriendliesOnly + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + + From a67a728a09773a1573e45c3f7408e20767260283 Mon Sep 17 00:00:00 2001 From: Mercy Ma Date: Fri, 1 Feb 2019 17:41:34 +0800 Subject: [PATCH 26/46] 2.7.0 release (#436) * 1.0.0 (#429) * Polish apache/incubator-dubbo-spring-boot-project#395 * Polish apache/incubator-dubbo-spring-boot-project#395 fixed issues * Polish apache/incubator-dubbo-spring-boot-project#395 Update documents * Update the root POM's parent * Replace ${project.version} to ${revision} in the "pom.xml" files * Update * Remove Netty Project * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * 1.0.0 (#431) * Polish apache/incubator-dubbo-spring-boot-project#395 * Polish apache/incubator-dubbo-spring-boot-project#395 fixed issues * Polish apache/incubator-dubbo-spring-boot-project#395 Update documents * Update the root POM's parent * Replace ${project.version} to ${revision} in the "pom.xml" files * Update * Remove Netty Project * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 : Update Documents * 2.7.0 (#433) * Polish apache/incubator-dubbo-spring-boot-project#395 * Polish apache/incubator-dubbo-spring-boot-project#395 fixed issues * Polish apache/incubator-dubbo-spring-boot-project#395 Update documents * Update the root POM's parent * Replace ${project.version} to ${revision} in the "pom.xml" files * Update * Remove Netty Project * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 : Update Documents * Polish : apache/incubator-dubbo-spring-boot-project#427 : Fixed include pattern * 1.0.0 (#435) * Polish apache/incubator-dubbo-spring-boot-project#395 * Polish apache/incubator-dubbo-spring-boot-project#395 fixed issues * Polish apache/incubator-dubbo-spring-boot-project#395 Update documents * Update the root POM's parent * Replace ${project.version} to ${revision} in the "pom.xml" files * Update * Remove Netty Project * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 : Update Documents * Polish : apache/incubator-dubbo-spring-boot-project#427 : Fixed include pattern * Polish : apache/incubator-dubbo-spring-boot-project#427 : Correct words --- README.md | 6 ++-- README_CN.md | 9 ++--- dubbo-spring-boot-actuator/README.md | 36 +++++++++---------- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 3 +- .../src/main/resources/application.properties | 3 +- 6 files changed, 26 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index f39343868..60cfbb8a6 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,14 @@ [![Build Status](https://travis-ci.org/apache/incubator-dubbo-spring-boot-project.svg?branch=master)](https://travis-ci.org/apache/incubator-dubbo-spring-boot-project) [![codecov](https://codecov.io/gh/apache/incubator-dubbo-spring-boot-project/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/incubator-dubbo-spring-boot-project) -[![Gitter](https://badges.gitter.im/alibaba/dubbo.svg)](https://gitter.im/alibaba/dubbo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) ![license](https://img.shields.io/github/license/apache/incubator-dubbo-spring-boot-project.svg) -![maven](https://img.shields.io/maven-central/v/com.alibaba.boot/dubbo-spring-boot-starter.svg) [Apache Dubbo(incubating)](https://github.com/apache/incubator-dubbo) Spring Boot Project makes it easy to create [Spring Boot](https://github.com/spring-projects/spring-boot/) application using Dubbo as RPC Framework. What's more, it aslo provides * [auto-configure features](dubbo-spring-boot-autoconfigure) (e.g., annotation-driven, auto configuration, externalized configuration). * [production-ready features](dubbo-spring-boot-actuator) (e.g., security, health checks, externalized configuration). -> Apache Dubbo(incubating) is a high-performance, java based [RPC](https://en.wikipedia.org/wiki/Remote_procedure_call) framework open-sourced by Alibaba. As in many RPC systems, dubbo is based around the idea of defining a service, specifying the methods that can be called remotely with their parameters and return types. On the server side, the server implements this interface and runs a dubbo server to handle client calls. On the client side, the client has a stub that provides the same methods as the server. +> Apache Dubbo (incubating) |ˈdʌbəʊ| is a high-performance, light weight, java based RPC framework. Dubbo offers three key functionalities, which include interface based remote call, fault tolerance & load balancing, and automatic service registration & discovery. ## [中文说明](README_CN.md) @@ -167,7 +165,7 @@ public interface DemoService { ```properties # Spring boot application spring.application.name=dubbo-auto-configuration-provider-demo - # Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service + # Base packages to scan Dubbo Component: @org.apache.dubbo.config.annotation.Service dubbo.scan.base-packages=org.apache.dubbo.spring.boot.demo.provider.service # Dubbo Application diff --git a/README_CN.md b/README_CN.md index 3912038ef..56187debc 100644 --- a/README_CN.md +++ b/README_CN.md @@ -2,20 +2,17 @@ [![Build Status](https://travis-ci.org/apache/incubator-dubbo-spring-boot-project.svg?branch=master)](https://travis-ci.org/apache/incubator-dubbo-spring-boot-project) [![codecov](https://codecov.io/gh/apache/incubator-dubbo-spring-boot-project/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/incubator-dubbo-spring-boot-project) -[![Gitter](https://badges.gitter.im/alibaba/dubbo.svg)](https://gitter.im/alibaba/dubbo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) ![license](https://img.shields.io/github/license/apache/incubator-dubbo-spring-boot-project.svg) -![maven](https://img.shields.io/maven-central/v/com.alibaba.boot/dubbo-spring-boot-starter.svg) -[Dubbo](https://github.com/alibaba/dubbo) Spring Boot 工程致力于简化 Dubbo RPC 框架在 +[Dubbo](https://dubbo.apache.org/zh-cn/index.html) Apache Dubbo™ (incubating)是一款高性能Java RPC框架。 [Spring Boot](https://github.com/spring-projects/spring-boot/) 应用场景的开发。同时也整合了 Spring Boot 特性: * [自动装配](dubbo-spring-boot-autoconfigure) (比如: 注解驱动, 自动装配等). * [Production-Ready](dubbo-spring-boot-actuator) (比如: 安全, 健康检查, 外部化配置等). +> Apache Dubbo (incubating) |ˈdʌbəʊ| 是一款高性能、轻量级的开源Java RPC框架,它提供了三大核心能力:面向接口的远程方法调用,智能容错和负载均衡,以及服务自动注册和发现。 -> Dubbo *|ˈdʌbəʊ|* is a high-performance, java based [RPC](https://en.wikipedia.org/wiki/Remote_procedure_call) framework open-sourced by Alibaba. As in many RPC systems, dubbo is based around the idea of defining a service, specifying the methods that can be called remotely with their parameters and return types. On the server side, the server implements this interface and runs a dubbo server to handle client calls. On the client side, the client has a stub that provides the same methods as the server. - ## [English README](README_CN.md) @@ -173,7 +170,7 @@ public interface DemoService { ```properties # Spring boot application spring.application.name=dubbo-auto-configuration-provider-demo - # Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service + # Base packages to scan Dubbo Component: @org.apache.dubbo.config.annotation.Service dubbo.scan.base-packages=org.apache.dubbo.spring.boot.demo.provider.service # Dubbo Application diff --git a/dubbo-spring-boot-actuator/README.md b/dubbo-spring-boot-actuator/README.md index 8f52e1bd4..ec743c619 100644 --- a/dubbo-spring-boot-actuator/README.md +++ b/dubbo-spring-boot-actuator/README.md @@ -122,16 +122,16 @@ externalized configuration [`StatusChecker`'s defaults](#statuschecker-defaults) - `META-INF/dubbo/internal/com.alibaba.dubbo.common.status.StatusChecker` declares Build-in `StatusChecker`s as follow : + `META-INF/dubbo/internal/org.apache.dubbo.common.status.StatusChecker` declares Build-in `StatusChecker`s as follow : ```properties -registry=com.alibaba.dubbo.registry.status.RegistryStatusChecker -spring=com.alibaba.dubbo.config.spring.status.SpringStatusChecker -datasource=com.alibaba.dubbo.config.spring.status.DataSourceStatusChecker -memory=com.alibaba.dubbo.common.status.support.MemoryStatusChecker -load=com.alibaba.dubbo.common.status.support.LoadStatusChecker -server=com.alibaba.dubbo.rpc.protocol.dubbo.status.ServerStatusChecker -threadpool=com.alibaba.dubbo.rpc.protocol.dubbo.status.ThreadPoolStatusChecker +registry=org.apache.dubbo.registry.status.RegistryStatusChecker +spring=org.apache.dubbo.config.spring.status.SpringStatusChecker +datasource=org.apache.dubbo.config.spring.status.DataSourceStatusChecker +memory=org.apache.dubbo.common.status.support.MemoryStatusChecker +load=org.apache.dubbo.common.status.support.LoadStatusChecker +server=org.apache.dubbo.rpc.protocol.dubbo.status.ServerStatusChecker +threadpool=org.apache.dubbo.rpc.protocol.dubbo.status.ThreadPoolStatusChecker ``` @@ -175,11 +175,11 @@ Actuator endpoint `dubbo` supports Actuator Endpoints : "dubbo": "2.7.0" }, "urls": { - "dubbo": "https://github.com/alibaba/dubbo", - "google-group": "http://groups.google.com/group/dubbo", - "github": "https://github.com/dubbo/dubbo-spring-boot-project", - "issues": "https://github.com/dubbo/dubbo-spring-boot-project/issues", - "git": "https://github.com/dubbo/dubbo-spring-boot-project.git" + "dubbo": "https://github.com/apache/incubator-dubbo/", + "google-group": "dev@dubbo.apache.org", + "github": "https://github.com/apache/incubator-dubbo-spring-boot-project", + "issues": "https://github.com/apache/incubator-dubbo-spring-boot-project/issues", + "git": "https://github.com/apache/incubator-dubbo-spring-boot-project.git" } } ``` @@ -222,7 +222,7 @@ The structure of JSON is simple Key-Value format , the key is property name as a "actives": null, "cache": null, "callbacks": null, - "class": "com.alibaba.dubbo.config.spring.ServiceBean", + "class": "org.apache.dubbo.config.spring.ServiceBean", "cluster": null, "connections": null, "delay": null, @@ -278,7 +278,7 @@ The key is the Bean name of `ServiceBean` , `ServiceBean`'s properties compose v "actives": null, "cache": null, "callbacks": null, - "class": "com.alibaba.dubbo.config.spring.ReferenceBean", + "class": "org.apache.dubbo.config.spring.ReferenceBean", "client": null, "cluster": null, "connections": null, @@ -315,7 +315,7 @@ The key is the Bean name of `ServiceBean` , `ServiceBean`'s properties compose v "validation": null, "version": "1.0.0", "invoker": { - "class": "com.alibaba.dubbo.common.bytecode.proxy0" + "class": "org.apache.dubbo.common.bytecode.proxy0" } } } @@ -334,7 +334,7 @@ The key is the string presentation of `@Reference` `Field` or `Method ` , `Refe "ApplicationConfig": { "dubbo-consumer-demo": { "architecture": null, - "class": "com.alibaba.dubbo.config.ApplicationConfig", + "class": "org.apache.dubbo.config.ApplicationConfig", "compiler": null, "dumpDirectory": null, "environment": null, @@ -364,7 +364,7 @@ The key is the string presentation of `@Reference` `Field` or `Method ` , `Refe "accesslog": null, "buffer": null, "charset": null, - "class": "com.alibaba.dubbo.config.ProtocolConfig", + "class": "org.apache.dubbo.config.ProtocolConfig", "client": null, "codec": null, "contextpath": null, diff --git a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/resources/application.properties b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/resources/application.properties index 4f9939cd4..b3de3d9c1 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/resources/application.properties +++ b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/resources/application.properties @@ -1,6 +1,6 @@ # Spring boot application spring.application.name=dubbo-auto-configuration-provider-demo -# Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service +# Base packages to scan Dubbo Component: @org.apache.dubbo.config.annotation.Service dubbo.scan.base-packages=org.apache.dubbo.spring.boot.demo.provider.service # Dubbo Application ## The default value of dubbo.application.name is ${spring.application.name} diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties index eca5996f4..d66c19dea 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties @@ -1,7 +1,6 @@ # Spring boot application spring.application.name=dubbo-registry-zookeeper-provider-sample - -# Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service +# Base packages to scan Dubbo Component: @org.apache.dubbo.config.annotation.Service dubbo.scan.base-packages=org.apache.dubbo.spring.boot.demo.provider.service # Dubbo Application diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/resources/application.properties b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/resources/application.properties index bf406798e..400759a7b 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/resources/application.properties +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/resources/application.properties @@ -1,7 +1,6 @@ # Spring boot application spring.application.name=dubbo-externalized-configuration-provider-sample - -# Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service +# Base packages to scan Dubbo Component: @org.apache.dubbo.config.annotation.Service dubbo.scan.base-packages=org.apache.dubbo.spring.boot.demo.provider.service # Dubbo Application From 033421d012cebb91345f62997d17350e973ead37 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Mon, 25 Feb 2019 14:41:47 +0800 Subject: [PATCH 27/46] Polish apache/incubator-dubbo-spring-boot-project#449 --- .../DelegatingPropertyResolver.java | 83 +++++++++++++++++++ ...DubboRelaxedBinding2AutoConfiguration.java | 2 +- ...oRelaxedBinding2AutoConfigurationTest.java | 16 ++++ pom.xml | 2 +- 4 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DelegatingPropertyResolver.java diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DelegatingPropertyResolver.java b/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DelegatingPropertyResolver.java new file mode 100644 index 000000000..b36d921d6 --- /dev/null +++ b/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DelegatingPropertyResolver.java @@ -0,0 +1,83 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.autoconfigure; + +import org.apache.dubbo.common.utils.Assert; +import org.springframework.core.env.PropertyResolver; +import org.springframework.lang.Nullable; + +/** + * Delegating {@link PropertyResolver} + * + * @since 2.7.1 + */ +class DelegatingPropertyResolver implements PropertyResolver { + + private final PropertyResolver delegate; + + DelegatingPropertyResolver(PropertyResolver delegate) { + Assert.notNull(delegate, "The delegate of PropertyResolver must not be null"); + this.delegate = delegate; + } + + @Override + public boolean containsProperty(String key) { + return delegate.containsProperty(key); + } + + @Override + @Nullable + public String getProperty(String key) { + return delegate.getProperty(key); + } + + @Override + public String getProperty(String key, String defaultValue) { + return delegate.getProperty(key, defaultValue); + } + + @Override + @Nullable + public T getProperty(String key, Class targetType) { + return delegate.getProperty(key, targetType); + } + + @Override + public T getProperty(String key, Class targetType, T defaultValue) { + return delegate.getProperty(key, targetType, defaultValue); + } + + @Override + public String getRequiredProperty(String key) throws IllegalStateException { + return delegate.getRequiredProperty(key); + } + + @Override + public T getRequiredProperty(String key, Class targetType) throws IllegalStateException { + return delegate.getRequiredProperty(key, targetType); + } + + @Override + public String resolvePlaceholders(String text) { + return delegate.resolvePlaceholders(text); + } + + @Override + public String resolveRequiredPlaceholders(String text) throws IllegalArgumentException { + return delegate.resolveRequiredPlaceholders(text); + } +} diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java b/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java index 97aa275f2..2b572731c 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java @@ -61,7 +61,7 @@ protected void customizePropertySources(MutablePropertySources propertySources) } }; ConfigurationPropertySources.attach(propertyResolver); - return propertyResolver; + return new DelegatingPropertyResolver(propertyResolver); } @ConditionalOnMissingBean(name = RELAXED_DUBBO_CONFIG_BINDER_BEAN_NAME, value = DubboConfigBinder.class) diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfigurationTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfigurationTest.java index 4aee5a50d..bc354dc71 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfigurationTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfigurationTest.java @@ -27,10 +27,13 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.core.env.Environment; import org.springframework.core.env.PropertyResolver; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.ClassUtils; +import java.util.Collection; + import static org.apache.dubbo.spring.boot.util.DubboUtils.BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME; import static org.apache.dubbo.spring.boot.util.DubboUtils.RELAXED_DUBBO_CONFIG_BINDER_BEAN_NAME; @@ -58,6 +61,12 @@ public class DubboRelaxedBinding2AutoConfigurationTest { @Autowired private ObjectProvider referenceAnnotationBeanPostProcessor; + @Autowired + private Environment environment; + + @Autowired + private Collection environments; + @Test public void testBeans() { Assert.assertTrue(ClassUtils.isAssignableValue(BinderDubboConfigBinder.class, dubboConfigBinder)); @@ -65,6 +74,13 @@ public void testBeans() { Assert.assertNotNull(serviceAnnotationBeanPostProcessor.getIfAvailable()); Assert.assertNotNull(referenceAnnotationBeanPostProcessor); Assert.assertNotNull(referenceAnnotationBeanPostProcessor.getIfAvailable()); + + Assert.assertNotNull(environment); + Assert.assertNotNull(environments); + + Assert.assertEquals(1, environments.size()); + + Assert.assertTrue(environments.contains(environment)); } } diff --git a/pom.xml b/pom.xml index 17f0e03a2..e8d9e32f9 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ 3.0.1 2.19.1 - 2.7.0 + 2.7.1-SNAPSHOT From fa4c06a042b904b6e05e96d4f4e24bca19e4997f Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 19 Mar 2019 13:53:04 +0800 Subject: [PATCH 28/46] Polish apache/incubator-dubbo-spring-boot-project#467 : Set "spring.main.allow-bean-definition-overriding" property to be true as default --- ...ultPropertiesEnvironmentPostProcessor.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java index 0efbc6b48..09aa40a0b 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java @@ -19,6 +19,7 @@ import org.apache.dubbo.config.ApplicationConfig; import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig; import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfigBinding; + import org.springframework.boot.SpringApplication; import org.springframework.boot.context.ContextIdApplicationContextInitializer; import org.springframework.boot.env.EnvironmentPostProcessor; @@ -73,6 +74,12 @@ public class DubboDefaultPropertiesEnvironmentPostProcessor implements Environme */ private static final String DUBBO_APPLICATION_QOS_ENABLE_PROPERTY = "dubbo.application.qos-enable"; + /** + * The property name of "spring.main.allow-bean-definition-overriding". + * Please refer to: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.1-Release-Notes#bean-overriding + */ + public static final String ALLOW_BEAN_DEFINITION_OVERRIDING_PROPERTY = "spring.main.allow-bean-definition-overriding"; + @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { MutablePropertySources propertySources = environment.getPropertySources(); @@ -92,6 +99,7 @@ private Map createDefaultProperties(ConfigurableEnvironment envi setDubboApplicationNameProperty(environment, defaultProperties); setDubboConfigMultipleProperty(defaultProperties); setDubboApplicationQosEnableProperty(defaultProperties); + setAllowBeanDefinitionOverriding(defaultProperties); return defaultProperties; } @@ -111,6 +119,18 @@ private void setDubboApplicationQosEnableProperty(Map defaultPro defaultProperties.put(DUBBO_APPLICATION_QOS_ENABLE_PROPERTY, Boolean.FALSE.toString()); } + /** + * Set {@link #ALLOW_BEAN_DEFINITION_OVERRIDING_PROPERTY "spring.main.allow-bean-definition-overriding"} to be + * true as default. + * + * @param defaultProperties the default {@link Properties properties} + * @see #ALLOW_BEAN_DEFINITION_OVERRIDING_PROPERTY + * @since 2.7.1 + */ + private void setAllowBeanDefinitionOverriding(Map defaultProperties) { + defaultProperties.put(ALLOW_BEAN_DEFINITION_OVERRIDING_PROPERTY, Boolean.TRUE.toString()); + } + /** * Copy from BusEnvironmentPostProcessor#addOrReplace(MutablePropertySources, Map) * From f705e64b14cf161c066ff4a452fcc654634d9a79 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 19 Mar 2019 14:08:57 +0800 Subject: [PATCH 29/46] Polish apache/incubator-dubbo-spring-boot-project#468 : Upgrade Dubbo 2.7.1 --- dubbo-spring-boot-parent/pom.xml | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dubbo-spring-boot-parent/pom.xml b/dubbo-spring-boot-parent/pom.xml index 9d7b1e8a9..fc43ffbc8 100644 --- a/dubbo-spring-boot-parent/pom.xml +++ b/dubbo-spring-boot-parent/pom.xml @@ -38,8 +38,8 @@ 1.8 UTF-8 UTF-8 - 2.1.2.RELEASE - 2.7.0 + 2.1.3.RELEASE + ${revision} -server -Xms256m -Xmx512m -XX:PermSize=64m -XX:MaxPermSize=128m -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true diff --git a/pom.xml b/pom.xml index e8d9e32f9..95f09ae57 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ 3.0.1 2.19.1 - 2.7.1-SNAPSHOT + 2.7.1 From a18ed488b577087edfbdf39ccf193174801d248a Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 19 Mar 2019 14:17:15 +0800 Subject: [PATCH 30/46] Polish apache/incubator-dubbo-spring-boot-project#437 : Remove -XX:PermSize=64m -XX:MaxPermSize=128m --- dubbo-spring-boot-parent/pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dubbo-spring-boot-parent/pom.xml b/dubbo-spring-boot-parent/pom.xml index fc43ffbc8..74c1f4eef 100644 --- a/dubbo-spring-boot-parent/pom.xml +++ b/dubbo-spring-boot-parent/pom.xml @@ -41,8 +41,7 @@ 2.1.3.RELEASE ${revision} - -server -Xms256m -Xmx512m -XX:PermSize=64m -XX:MaxPermSize=128m -Dfile.encoding=UTF-8 - -Djava.net.preferIPv4Stack=true + -server -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true From 63d54c12f0794308b7f4e5e30b04b320d4a61bfa Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 19 Mar 2019 16:04:38 +0800 Subject: [PATCH 31/46] Fix the issues of test cases --- ...dpointAnnotationAutoConfigurationTest.java | 7 +- .../DubboEndpointAutoConfigurationTest.java | 7 +- .../DubboApplicationContextInitializer.java | 106 ++++++++++++++++++ .../main/resources/META-INF/spring.factories | 4 +- 4 files changed, 117 insertions(+), 7 deletions(-) create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java diff --git a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java b/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java index d9747cc08..954ad7a9a 100644 --- a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java +++ b/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java @@ -16,8 +16,6 @@ */ package org.apache.dubbo.spring.boot.actuate.autoconfigure; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.dubbo.config.annotation.Service; import org.apache.dubbo.spring.boot.actuate.endpoint.DubboConfigsMetadataEndpoint; import org.apache.dubbo.spring.boot.actuate.endpoint.DubboMetadataEndpoint; @@ -25,6 +23,9 @@ import org.apache.dubbo.spring.boot.actuate.endpoint.DubboReferencesMetadataEndpoint; import org.apache.dubbo.spring.boot.actuate.endpoint.DubboServicesMetadataEndpoint; import org.apache.dubbo.spring.boot.actuate.endpoint.DubboShutdownEndpoint; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -159,7 +160,7 @@ public void testServices() { Assert.assertEquals(1, services.size()); - Map demoServiceMeta = services.get("ServiceBean:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAnnotationAutoConfigurationTest$DemoService:1.0.0"); + Map demoServiceMeta = services.get("providers:my-protocol:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAnnotationAutoConfigurationTest$DemoService:1.0.0"); Assert.assertEquals("1.0.0", demoServiceMeta.get("version")); diff --git a/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java b/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java index 9f5f51ec5..3227723a8 100644 --- a/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java +++ b/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java @@ -16,8 +16,6 @@ */ package org.apache.dubbo.spring.boot.actuate.autoconfigure; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.dubbo.config.annotation.Service; import org.apache.dubbo.spring.boot.actuate.endpoint.DubboEndpoint; import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboConfigsMetadata; @@ -25,6 +23,9 @@ import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboReferencesMetadata; import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboServicesMetadata; import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboShutdownMetadata; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -163,7 +164,7 @@ public void testServices() { Assert.assertEquals(1, services.size()); - Map demoServiceMeta = services.get("ServiceBean:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAutoConfigurationTest$DemoService:1.0.0"); + Map demoServiceMeta = services.get("providers:my-protocol:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAutoConfigurationTest$DemoService:1.0.0"); Assert.assertEquals("1.0.0", demoServiceMeta.get("version")); diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java new file mode 100644 index 000000000..8b62c7516 --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java @@ -0,0 +1,106 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.context; + +import org.apache.dubbo.config.AbstractConfig; +import org.apache.dubbo.config.spring.context.config.NamePropertyDefaultValueDubboConfigBeanCustomizer; + +import org.springframework.beans.BeanUtils; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; +import org.springframework.context.ApplicationContextInitializer; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.Ordered; + +import java.lang.reflect.Method; + +import static org.apache.dubbo.config.spring.context.config.NamePropertyDefaultValueDubboConfigBeanCustomizer.BEAN_NAME; +import static org.apache.dubbo.config.spring.util.BeanRegistrar.registerInfrastructureBean; +import static org.springframework.util.ReflectionUtils.findMethod; +import static org.springframework.util.ReflectionUtils.invokeMethod; + +/** + * Dubbo {@link ApplicationContextInitializer} implementation + * + * @see ApplicationContextInitializer + * @since 2.7.1 + */ +public class DubboApplicationContextInitializer implements ApplicationContextInitializer, Ordered { + + @Override + public void initialize(ConfigurableApplicationContext applicationContext) { + overrideBeanDefinitions(applicationContext); + } + + private void overrideBeanDefinitions(ConfigurableApplicationContext applicationContext) { + applicationContext.addBeanFactoryPostProcessor(new OverrideBeanDefinitionRegistryPostProcessor()); + } + + @Override + public int getOrder() { + return HIGHEST_PRECEDENCE; + } + + /** + * {@link BeanDefinitionRegistryPostProcessor} + */ + private static class OverrideBeanDefinitionRegistryPostProcessor implements BeanDefinitionRegistryPostProcessor { + + @Override + public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { + registerInfrastructureBean(registry, BEAN_NAME, DubboConfigBeanCustomizer.class); + } + + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { + } + } + + /** + * Current implementation will be replaced {@link NamePropertyDefaultValueDubboConfigBeanCustomizer} in Dubbo 2.7.2 + */ + private static class DubboConfigBeanCustomizer extends NamePropertyDefaultValueDubboConfigBeanCustomizer { + @Override + public void customize(String beanName, AbstractConfig dubboConfigBean) { + boolean valid = isValidPropertyName(dubboConfigBean, beanName); + if (valid) { + super.customize(beanName, dubboConfigBean); + } + } + + private boolean isValidPropertyName(AbstractConfig dubboConfigBean, String propertyValue) { + boolean valid = true; + String propertyName = "name"; + // AbstractConfig.checkName(String,String) + Method method = findMethod(AbstractConfig.class, "checkName", String.class, String.class); + try { + if (!method.isAccessible()) { + method.setAccessible(true); + } + if (BeanUtils.getPropertyDescriptor(dubboConfigBean.getClass(), propertyName) != null) { + invokeMethod(method, null, propertyName, propertyValue); + } + } catch (IllegalStateException e) { + valid = false; + } + + return valid; + } + } +} diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories b/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories index 08db894ac..e3005dba2 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories @@ -6,4 +6,6 @@ org.apache.dubbo.spring.boot.context.event.OverrideDubboConfigApplicationListene org.apache.dubbo.spring.boot.context.event.WelcomeLogoApplicationListener,\ org.apache.dubbo.spring.boot.context.event.AwaitingNonWebApplicationListener org.springframework.boot.env.EnvironmentPostProcessor=\ -org.apache.dubbo.spring.boot.env.DubboDefaultPropertiesEnvironmentPostProcessor \ No newline at end of file +org.apache.dubbo.spring.boot.env.DubboDefaultPropertiesEnvironmentPostProcessor +org.springframework.context.ApplicationContextInitializer=\ +org.apache.dubbo.spring.boot.context.DubboApplicationContextInitializer \ No newline at end of file From 367d707eed79cbb551ef1f79bab630ae092cfbb2 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 19 Mar 2019 16:37:44 +0800 Subject: [PATCH 32/46] Update Samples --- .../consumer-sample/src/main/resources/application.yml | 3 ++- .../spring/boot/demo/provider/bootstrap/EmbeddedZooKeeper.java | 1 + .../provider-sample/src/main/resources/application.properties | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/resources/application.yml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/resources/application.yml index 88846fbed..a533b4d60 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/resources/application.yml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/resources/application.yml @@ -12,4 +12,5 @@ embedded: dubbo: registry: - address: zookeeper://127.0.0.1:${embedded.zookeeper.port} \ No newline at end of file + address: zookeeper://127.0.0.1:${embedded.zookeeper.port} + file: ${user.home}/dubbo-cache/${spring.application.name}/dubbo.cache \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/EmbeddedZooKeeper.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/EmbeddedZooKeeper.java index 1758fc858..56ecea477 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/EmbeddedZooKeeper.java +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/EmbeddedZooKeeper.java @@ -93,6 +93,7 @@ public EmbeddedZooKeeper() { * Construct an EmbeddedZooKeeper with the provided port. * * @param clientPort port for ZooKeeper server to bind to + * @param daemon is daemon or not thread. */ public EmbeddedZooKeeper(int clientPort, boolean daemon) { this.clientPort = clientPort; diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties index d66c19dea..0c9116cdd 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties @@ -16,6 +16,7 @@ dubbo.protocol.port=-1 ## Dubbo Registry dubbo.registry.address=zookeeper://127.0.0.1:${embedded.zookeeper.port} +dubbo.registry.file = ${user.home}/dubbo-cache/${spring.application.name}/dubbo.cache ## DemoService version demo.service.version=1.0.0 \ No newline at end of file From 31c67715b43c839369065edc34edfc55b166099d Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 19 Mar 2019 16:42:54 +0800 Subject: [PATCH 33/46] Update default version using Dubbo's version --- .../boot/context/event/WelcomeLogoApplicationListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListener.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListener.java index f053227ff..05c8a5de8 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListener.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListener.java @@ -17,6 +17,7 @@ package org.apache.dubbo.spring.boot.context.event; import org.apache.dubbo.common.Version; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; @@ -75,7 +76,7 @@ String buildBannerText() { bannerTextBuilder .append(LINE_SEPARATOR) .append(LINE_SEPARATOR) - .append(" :: Dubbo Spring Boot (v").append(Version.getVersion(getClass(), "1.0.0")).append(") : ") + .append(" :: Dubbo Spring Boot (v").append(Version.getVersion(getClass(), Version.getVersion())).append(") : ") .append(DUBBO_SPRING_BOOT_GITHUB_URL) .append(LINE_SEPARATOR) .append(" :: Dubbo (v").append(Version.getVersion()).append(") : ") From 4c5d205182123aedbb3cbf8a9b66f4fc0b346404 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Tue, 19 Mar 2019 17:03:17 +0800 Subject: [PATCH 34/46] Polish apache/incubator-dubbo-spring-boot-project#456 : Update the Zookeeper dependencies --- .../consumer-sample/pom.xml | 17 +++++------------ .../provider-sample/pom.xml | 18 +++++------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml index 1941193ea..edaf3049c 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml @@ -53,19 +53,12 @@ ${revision} + - org.apache.curator - curator-framework - - - - org.apache.curator - curator-recipes - - - - org.apache.zookeeper - zookeeper + org.apache.dubbo + dubbo-dependencies-zookeeper + ${dubbo.version} + pom diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml index c41c446a5..8f1719afb 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml @@ -55,20 +55,12 @@ ${revision} - + - org.apache.zookeeper - zookeeper - - - - org.apache.curator - curator-framework - - - - org.apache.curator - curator-recipes + org.apache.dubbo + dubbo-dependencies-zookeeper + ${dubbo.version} + pom From 49aef0b82bcdd2b1e9fda5e2ecd3e95a57ad4fbc Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Wed, 20 Mar 2019 12:45:02 +0800 Subject: [PATCH 35/46] Polish apache/incubator-dubbo-spring-boot-project#458 : dubbo.metadata-report.address propertie description not provided --- dubbo-spring-boot-actuator/pom.xml | 7 - dubbo-spring-boot-autoconfigure/pom.xml | 7 - .../DubboEndpointAutoConfiguration.java | 3 + .../autoconfigure/DubboAutoConfiguration.java | 8 +- .../DubboConfigurationProperties.java | 288 +++++ .../spring-configuration-metadata.json | 1098 ----------------- dubbo-spring-boot-parent/pom.xml | 3 +- 7 files changed, 298 insertions(+), 1116 deletions(-) create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java delete mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json diff --git a/dubbo-spring-boot-actuator/pom.xml b/dubbo-spring-boot-actuator/pom.xml index ef7eed38c..bf905f1bf 100644 --- a/dubbo-spring-boot-actuator/pom.xml +++ b/dubbo-spring-boot-actuator/pom.xml @@ -58,13 +58,6 @@ true - - - org.springframework.boot - spring-boot-configuration-processor - true - - org.apache.dubbo diff --git a/dubbo-spring-boot-autoconfigure/pom.xml b/dubbo-spring-boot-autoconfigure/pom.xml index 83f1a4b29..190bfdb9d 100644 --- a/dubbo-spring-boot-autoconfigure/pom.xml +++ b/dubbo-spring-boot-autoconfigure/pom.xml @@ -54,13 +54,6 @@ true - - - org.springframework.boot - spring-boot-configuration-processor - true - - org.apache.dubbo diff --git a/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfiguration.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfiguration.java index a74cab1f0..92a9ba0aa 100644 --- a/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfiguration.java +++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfiguration.java @@ -20,11 +20,13 @@ import org.apache.dubbo.spring.boot.actuate.endpoint.DubboEndpoint; import org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration; import org.apache.dubbo.spring.boot.autoconfigure.DubboRelaxedBindingAutoConfiguration; + import org.springframework.boot.actuate.condition.ConditionalOnEnabledEndpoint; import org.springframework.boot.actuate.endpoint.Endpoint; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -41,6 +43,7 @@ DubboAutoConfiguration.class, DubboRelaxedBindingAutoConfiguration.class }) +@EnableConfigurationProperties(DubboEndpoint.class) public class DubboEndpointAutoConfiguration { @Bean diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java index f49e49e41..059a3e6a2 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java @@ -22,13 +22,16 @@ import org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor; import org.apache.dubbo.config.spring.context.annotation.DubboConfigConfiguration; import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig; + import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.core.env.PropertyResolver; import java.util.Set; @@ -53,6 +56,7 @@ @ConditionalOnProperty(prefix = DUBBO_PREFIX, name = "enabled", matchIfMissing = true) @Configuration @AutoConfigureAfter(DubboRelaxedBindingAutoConfiguration.class) +@EnableConfigurationProperties(DubboConfigurationProperties.class) public class DubboAutoConfiguration { /** @@ -87,7 +91,7 @@ public ReferenceAnnotationBeanPostProcessor referenceAnnotationBeanPostProcessor * @see EnableDubboConfig * @see DubboConfigConfiguration.Single */ - @EnableDubboConfig + @Import(DubboConfigConfiguration.Single.class) protected static class SingleDubboConfigConfiguration { } @@ -98,7 +102,7 @@ protected static class SingleDubboConfigConfiguration { * @see DubboConfigConfiguration.Multiple */ @ConditionalOnProperty(prefix = DUBBO_CONFIG_PREFIX, name = MULTIPLE_CONFIG_PROPERTY_NAME, matchIfMissing = true) - @EnableDubboConfig(multiple = true) + @Import(DubboConfigConfiguration.Multiple.class) protected static class MultipleDubboConfigConfiguration { } diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java new file mode 100644 index 000000000..beadc50ec --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java @@ -0,0 +1,288 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.autoconfigure; + +import org.apache.dubbo.config.ApplicationConfig; +import org.apache.dubbo.config.ConsumerConfig; +import org.apache.dubbo.config.MetadataReportConfig; +import org.apache.dubbo.config.ModuleConfig; +import org.apache.dubbo.config.MonitorConfig; +import org.apache.dubbo.config.ProtocolConfig; +import org.apache.dubbo.config.ProviderConfig; +import org.apache.dubbo.config.RegistryConfig; +import org.apache.dubbo.config.spring.ConfigCenterBean; +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; + +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; + +import static org.apache.dubbo.spring.boot.util.DubboUtils.DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_PREFIX; + +/** + * Dubbo {@link ConfigurationProperties Config Properties} only used to generate JSON metadata(non-public class) + * + * @since 2.7.1 + */ +@ConfigurationProperties(DUBBO_PREFIX) +class DubboConfigurationProperties { + + @NestedConfigurationProperty + private Config config = new Config(); + + @NestedConfigurationProperty + private Scan scan = new Scan(); + + // Single Config Bindings + + private ApplicationConfig application = new ApplicationConfig(); + + private ModuleConfig module = new ModuleConfig(); + + private RegistryConfig registry = new RegistryConfig(); + + private ProtocolConfig protocol = new ProtocolConfig(); + + private MonitorConfig monitor = new MonitorConfig(); + + private ProviderConfig provider = new ProviderConfig(); + + private ConsumerConfig consumer = new ConsumerConfig(); + + private ConfigCenterBean configCenter = new ConfigCenterBean(); + + private MetadataReportConfig metadataReport = new MetadataReportConfig(); + + // Multiple Config Bindings + + private Map applications = new LinkedHashMap<>(); + + private Map modules = new LinkedHashMap<>(); + + private Map registrys = new LinkedHashMap<>(); + + private Map protocols = new LinkedHashMap<>(); + + private Map monitors = new LinkedHashMap<>(); + + private Map providers = new LinkedHashMap<>(); + + private Map consumers = new LinkedHashMap<>(); + + private Map configCenters = new LinkedHashMap<>(); + + private Map metadataReports = new LinkedHashMap<>(); + + public Config getConfig() { + return config; + } + + public void setConfig(Config config) { + this.config = config; + } + + public Scan getScan() { + return scan; + } + + public void setScan(Scan scan) { + this.scan = scan; + } + + public ApplicationConfig getApplication() { + return application; + } + + public void setApplication(ApplicationConfig application) { + this.application = application; + } + + public ModuleConfig getModule() { + return module; + } + + public void setModule(ModuleConfig module) { + this.module = module; + } + + public RegistryConfig getRegistry() { + return registry; + } + + public void setRegistry(RegistryConfig registry) { + this.registry = registry; + } + + public ProtocolConfig getProtocol() { + return protocol; + } + + public void setProtocol(ProtocolConfig protocol) { + this.protocol = protocol; + } + + public MonitorConfig getMonitor() { + return monitor; + } + + public void setMonitor(MonitorConfig monitor) { + this.monitor = monitor; + } + + public ProviderConfig getProvider() { + return provider; + } + + public void setProvider(ProviderConfig provider) { + this.provider = provider; + } + + public ConsumerConfig getConsumer() { + return consumer; + } + + public void setConsumer(ConsumerConfig consumer) { + this.consumer = consumer; + } + + public ConfigCenterBean getConfigCenter() { + return configCenter; + } + + public void setConfigCenter(ConfigCenterBean configCenter) { + this.configCenter = configCenter; + } + + public MetadataReportConfig getMetadataReport() { + return metadataReport; + } + + public void setMetadataReport(MetadataReportConfig metadataReport) { + this.metadataReport = metadataReport; + } + + public Map getApplications() { + return applications; + } + + public void setApplications(Map applications) { + this.applications = applications; + } + + public Map getModules() { + return modules; + } + + public void setModules(Map modules) { + this.modules = modules; + } + + public Map getRegistrys() { + return registrys; + } + + public void setRegistrys(Map registrys) { + this.registrys = registrys; + } + + public Map getProtocols() { + return protocols; + } + + public void setProtocols(Map protocols) { + this.protocols = protocols; + } + + public Map getMonitors() { + return monitors; + } + + public void setMonitors(Map monitors) { + this.monitors = monitors; + } + + public Map getProviders() { + return providers; + } + + public void setProviders(Map providers) { + this.providers = providers; + } + + public Map getConsumers() { + return consumers; + } + + public void setConsumers(Map consumers) { + this.consumers = consumers; + } + + public Map getConfigCenters() { + return configCenters; + } + + public void setConfigCenters(Map configCenters) { + this.configCenters = configCenters; + } + + public Map getMetadataReports() { + return metadataReports; + } + + public void setMetadataReports(Map metadataReports) { + this.metadataReports = metadataReports; + } + + static class Config { + + /** + * Indicates multiple properties binding from externalized configuration or not. + */ + private boolean multiple = DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE; + + public boolean isMultiple() { + return multiple; + } + + public void setMultiple(boolean multiple) { + this.multiple = multiple; + } + } + + static class Scan { + + /** + * The basePackages to scan , the multiple-value is delimited by comma + * + * @see EnableDubbo#scanBasePackages() + */ + private Set basePackages = new LinkedHashSet<>(); + + public Set getBasePackages() { + return basePackages; + } + + public void setBasePackages(Set basePackages) { + this.basePackages = basePackages; + } + } +} diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json b/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json deleted file mode 100644 index d8101217c..000000000 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json +++ /dev/null @@ -1,1098 +0,0 @@ -{ - "hints": [], - "groups": [], - "properties": [ - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.architecture", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.compiler", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.default", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.dump-directory", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.environment", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.logger", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.monitor", - "type": "org.apache.dubbo.config.MonitorConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.name", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.organization", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.owner", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.parameters", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.qos-accept-foreign-ip", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.qos-enable", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.qos-port", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.registries", - "type": "java.util.List" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.registry", - "type": "org.apache.dubbo.config.RegistryConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.version", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.applications", - "description": "Multiple {@link ApplicationConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.DubboConfigProperties", - "name": "dubbo.config.multiple", - "description": "Indicates multiple properties binding from externalized configuration or not.", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.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": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.actives", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.application", - "type": "org.apache.dubbo.config.ApplicationConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.async", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.cache", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.callbacks", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.check", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.client", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.cluster", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.connections", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.default", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.filter", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.generic", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.group", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.init", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "deprecated": true, - "name": "dubbo.consumer.injvm", - "type": "java.lang.Boolean", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.layer", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.lazy", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.listener", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.loadbalance", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "deprecated": true, - "name": "dubbo.consumer.local", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.merger", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.mock", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.module", - "type": "org.apache.dubbo.config.ModuleConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.monitor", - "type": "org.apache.dubbo.config.MonitorConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.onconnect", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.ondisconnect", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.owner", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.parameters", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.proxy", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.reconnect", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.registries", - "type": "java.util.List" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.registry", - "type": "org.apache.dubbo.config.RegistryConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.retries", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.scope", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.sent", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.sticky", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.stub", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.timeout", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.validation", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.version", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.consumers", - "description": "Multiple {@link ConsumerConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.default", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.monitor", - "type": "org.apache.dubbo.config.MonitorConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.name", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.organization", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.owner", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.registries", - "type": "java.util.List" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.registry", - "type": "org.apache.dubbo.config.RegistryConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.version", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.modules", - "description": "Multiple {@link ModuleConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.address", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.default", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.group", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.parameters", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.password", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.protocol", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.username", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.version", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.monitors", - "description": "Multiple {@link MonitorConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.accepts", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.accesslog", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.buffer", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.charset", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.client", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.codec", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.contextpath", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.default", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.dispatcher", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "deprecated": true, - "name": "dubbo.protocol.dispather", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.exchanger", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.heartbeat", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.host", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.iothreads", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.name", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.networker", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.parameters", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "deprecated": true, - "name": "dubbo.protocol.path", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.payload", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.port", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.prompt", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.queues", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.register", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.serialization", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.server", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.status", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.telnet", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.threadpool", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.threads", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.transporter", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.protocols", - "description": "Multiple {@link ProtocolConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.accepts", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.accesslog", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.actives", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.application", - "type": "org.apache.dubbo.config.ApplicationConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.async", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.buffer", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.cache", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.callbacks", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.charset", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.client", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.cluster", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.codec", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.connections", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.contextpath", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "deprecated": true, - "name": "dubbo.provider.default", - "type": "java.lang.Boolean", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.delay", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.deprecated", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.dispatcher", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "deprecated": true, - "name": "dubbo.provider.dispather", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.document", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.dynamic", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.exchanger", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.executes", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.export", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.filter", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.group", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.host", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.iothreads", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.layer", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.listener", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.loadbalance", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "deprecated": true, - "name": "dubbo.provider.local", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.merger", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.mock", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.module", - "type": "org.apache.dubbo.config.ModuleConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.monitor", - "type": "org.apache.dubbo.config.MonitorConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.networker", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.onconnect", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.ondisconnect", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.owner", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.parameters", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "deprecated": true, - "name": "dubbo.provider.path", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.payload", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "deprecated": true, - "name": "dubbo.provider.port", - "type": "java.lang.Integer", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.prompt", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.protocol", - "type": "org.apache.dubbo.config.ProtocolConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.protocols", - "type": "java.util.List" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.proxy", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.queues", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.register", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.registries", - "type": "java.util.List" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.registry", - "type": "org.apache.dubbo.config.RegistryConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.retries", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.scope", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.sent", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.serialization", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.server", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.status", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.stub", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.telnet", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.threadpool", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.threads", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.timeout", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.token", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.transporter", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.validation", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.version", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.wait", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.warmup", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.weight", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.providers", - "description": "Multiple {@link ProviderConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.registries", - "description": "Multiple {@link RegistryConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.address", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.check", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.client", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.cluster", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.default", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.dynamic", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.file", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.group", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.parameters", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.password", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.port", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.protocol", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.register", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.server", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.session", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.subscribe", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.timeout", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "deprecated": true, - "name": "dubbo.registry.transport", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.transporter", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.username", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.version", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "deprecated": true, - "name": "dubbo.registry.wait", - "type": "java.lang.Integer", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.spring.boot.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 diff --git a/dubbo-spring-boot-parent/pom.xml b/dubbo-spring-boot-parent/pom.xml index 74c1f4eef..085092010 100644 --- a/dubbo-spring-boot-parent/pom.xml +++ b/dubbo-spring-boot-parent/pom.xml @@ -226,11 +226,10 @@ maven-compiler-plugin ${maven-compiler-plugin.version} - -proc:none true ${java.source.version} ${java.target.version} - ${file.encoding} + ${project.build.sourceEncoding} From 9429525ba0fa41d8f9b31f55b6c81dbbde5d36e2 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Wed, 20 Mar 2019 12:55:17 +0800 Subject: [PATCH 36/46] Polish apache/incubator-dubbo-spring-boot-project#458 : dubbo.metadata-report.address propertie description not provided --- .../autoconfigure/DubboConfigurationProperties.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java index beadc50ec..3270eb4c4 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java @@ -53,23 +53,31 @@ class DubboConfigurationProperties { private Scan scan = new Scan(); // Single Config Bindings - + @NestedConfigurationProperty private ApplicationConfig application = new ApplicationConfig(); + @NestedConfigurationProperty private ModuleConfig module = new ModuleConfig(); + @NestedConfigurationProperty private RegistryConfig registry = new RegistryConfig(); + @NestedConfigurationProperty private ProtocolConfig protocol = new ProtocolConfig(); + @NestedConfigurationProperty private MonitorConfig monitor = new MonitorConfig(); + @NestedConfigurationProperty private ProviderConfig provider = new ProviderConfig(); + @NestedConfigurationProperty private ConsumerConfig consumer = new ConsumerConfig(); + @NestedConfigurationProperty private ConfigCenterBean configCenter = new ConfigCenterBean(); + @NestedConfigurationProperty private MetadataReportConfig metadataReport = new MetadataReportConfig(); // Multiple Config Bindings From a5815ea521527454215474157f752ce10a511f6b Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Wed, 20 Mar 2019 13:02:02 +0800 Subject: [PATCH 37/46] Update 2.7.1 --- README.md | 4 ++-- README_CN.md | 4 ++-- dubbo-spring-boot-actuator/README.md | 6 +++--- dubbo-spring-boot-autoconfigure/README.md | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c235eaab2..f59b98a98 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by addi ```xml 2.1.1.RELEASE - 2.7.0 + 2.7.1 @@ -70,7 +70,7 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by addi org.apache.dubbo dubbo-spring-boot-starter - 2.7.0 + 2.7.1 diff --git a/README_CN.md b/README_CN.md index 56187debc..0ad05b862 100644 --- a/README_CN.md +++ b/README_CN.md @@ -22,7 +22,7 @@ ```xml 2.1.1.RELEASE - 2.7.0 + 2.7.1 @@ -72,7 +72,7 @@ org.apache.dubbo dubbo-spring-boot-starter - 2.7.0 + 2.7.1 diff --git a/dubbo-spring-boot-actuator/README.md b/dubbo-spring-boot-actuator/README.md index ec743c619..659006c75 100644 --- a/dubbo-spring-boot-actuator/README.md +++ b/dubbo-spring-boot-actuator/README.md @@ -22,7 +22,7 @@ You can introduce the latest `dubbo-spring-boot-actuator` to your project by ad org.apache.dubbo dubbo-spring-boot-actuator - 2.7.0 + 2.7.1 ``` @@ -171,8 +171,8 @@ Actuator endpoint `dubbo` supports Actuator Endpoints : { "timestamp": 1516623290166, "versions": { - "dubbo-spring-boot": "2.7.0", - "dubbo": "2.7.0" + "dubbo-spring-boot": "2.7.1", + "dubbo": "2.7.1" }, "urls": { "dubbo": "https://github.com/apache/incubator-dubbo/", diff --git a/dubbo-spring-boot-autoconfigure/README.md b/dubbo-spring-boot-autoconfigure/README.md index e27178d90..ac33ef440 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 org.apache.dubbo dubbo-spring-boot-autoconfigure - 2.7.0 + 2.7.1 ``` From 7bc44d2afea3cf5bf866cb5ce7311ac0dc1c7a89 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Wed, 20 Mar 2019 13:19:10 +0800 Subject: [PATCH 38/46] Polish apache/incubator-dubbo-spring-boot-project#458 : Add "override" property --- .../DubboConfigurationProperties.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java index 3270eb4c4..d24a98296 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java @@ -36,6 +36,7 @@ import java.util.Set; import static org.apache.dubbo.spring.boot.util.DubboUtils.DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE; import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_PREFIX; /** @@ -267,6 +268,19 @@ static class Config { */ private boolean multiple = DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE; + /** + * The property name of override Dubbo config + */ + private boolean override = DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE; + + public boolean isOverride() { + return override; + } + + public void setOverride(boolean override) { + this.override = override; + } + public boolean isMultiple() { return multiple; } From 7e0816c05368c7c6fb8354f368398ce987e82aed Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Wed, 20 Mar 2019 16:03:58 +0800 Subject: [PATCH 39/46] Polish apache/incubator-dubbo-spring-boot-project#451 : Duplicate application configs --- .../DubboConfigurationProperties.java | 10 -- .../config/DubboConfigBeanCustomizer.java | 65 ++++++++++ ...ConfigBeanDefinitionConflictProcessor.java | 120 ++++++++++++++++++ ...deBeanDefinitionRegistryPostProcessor.java | 43 +++++++ .../DubboApplicationContextInitializer.java | 63 +-------- ...ultPropertiesEnvironmentPostProcessor.java | 37 +----- .../dubbo/spring/boot/util/DubboUtils.java | 46 +++++++ ...igBeanDefinitionConflictProcessorTest.java | 109 ++++++++++++++++ .../spring/boot/util/DubboUtilsTest.java | 12 ++ .../test/resources/META-INF/dubbo.properties | 1 + .../META-INF/spring/dubbo-context.xml | 14 ++ 11 files changed, 419 insertions(+), 101 deletions(-) create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanCustomizer.java create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessor.java create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/OverrideBeanDefinitionRegistryPostProcessor.java create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessorTest.java create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/dubbo.properties create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/spring/dubbo-context.xml diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java index d24a98296..495c152ff 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java @@ -83,8 +83,6 @@ class DubboConfigurationProperties { // Multiple Config Bindings - private Map applications = new LinkedHashMap<>(); - private Map modules = new LinkedHashMap<>(); private Map registrys = new LinkedHashMap<>(); @@ -189,14 +187,6 @@ public void setMetadataReport(MetadataReportConfig metadataReport) { this.metadataReport = metadataReport; } - public Map getApplications() { - return applications; - } - - public void setApplications(Map applications) { - this.applications = applications; - } - public Map getModules() { return modules; } diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanCustomizer.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanCustomizer.java new file mode 100644 index 000000000..518aed829 --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanCustomizer.java @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.beans.factory.config; + +import org.apache.dubbo.config.AbstractConfig; +import org.apache.dubbo.config.spring.context.config.NamePropertyDefaultValueDubboConfigBeanCustomizer; + +import org.springframework.beans.BeanUtils; + +import java.lang.reflect.Method; + +import static org.springframework.util.ReflectionUtils.findMethod; +import static org.springframework.util.ReflectionUtils.invokeMethod; + + +/** + * Current implementation will be replaced {@link NamePropertyDefaultValueDubboConfigBeanCustomizer} in Dubbo 2.7.2 + * + * @since 2.7.1 + * @deprecated + */ +@Deprecated +class DubboConfigBeanCustomizer extends NamePropertyDefaultValueDubboConfigBeanCustomizer { + + @Override + public void customize(String beanName, AbstractConfig dubboConfigBean) { + boolean valid = isValidPropertyName(dubboConfigBean, beanName); + if (valid) { + super.customize(beanName, dubboConfigBean); + } + } + + private boolean isValidPropertyName(AbstractConfig dubboConfigBean, String propertyValue) { + boolean valid = true; + String propertyName = "name"; + // AbstractConfig.checkName(String,String) + Method method = findMethod(AbstractConfig.class, "checkName", String.class, String.class); + try { + if (!method.isAccessible()) { + method.setAccessible(true); + } + if (BeanUtils.getPropertyDescriptor(dubboConfigBean.getClass(), propertyName) != null) { + invokeMethod(method, null, propertyName, propertyValue); + } + } catch (IllegalStateException e) { + valid = false; + } + + return valid; + } +} diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessor.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessor.java new file mode 100644 index 000000000..807610186 --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessor.java @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.beans.factory.config; + +import org.apache.dubbo.config.ApplicationConfig; +import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.BeanFactoryUtils; +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; +import org.springframework.core.Ordered; +import org.springframework.core.env.Environment; + +import java.util.Objects; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors; +import static org.springframework.context.ConfigurableApplicationContext.ENVIRONMENT_BEAN_NAME; + +/** + * Dubbo Config {@link BeanDefinition Bean Definition} {@link BeanDefinitionRegistryPostProcessor processor} + * to resolve conflict + * + * @see BeanDefinition + * @see BeanDefinitionRegistryPostProcessor + * @since 2.7.1 + */ +public class DubboConfigBeanDefinitionConflictProcessor implements BeanDefinitionRegistryPostProcessor, Ordered { + + private final Logger logger = LoggerFactory.getLogger(getClass()); + + private BeanDefinitionRegistry registry; + + private Environment environment; + + @Override + public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { + this.registry = registry; + } + + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { + resolveUniqueApplicationConfigBean(registry, beanFactory); + } + + /** + * Resolve the unique {@link ApplicationConfig} Bean + * + * @param registry {@link BeanDefinitionRegistry} instance + * @param beanFactory {@link ConfigurableListableBeanFactory} instance + * @see EnableDubboConfig + */ + private void resolveUniqueApplicationConfigBean(BeanDefinitionRegistry registry, + ConfigurableListableBeanFactory beanFactory) { + + this.environment = beanFactory.getBean(ENVIRONMENT_BEAN_NAME, Environment.class); + + String[] beansNames = beanNamesForTypeIncludingAncestors(beanFactory, ApplicationConfig.class); + + if (beansNames.length < 2) { // If the number of ApplicationConfig beans is less than two, return immediately. + return; + } + + // Remove ApplicationConfig Beans that are configured by "dubbo.application.*" + Stream.of(beansNames) + .filter(this::isConfiguredApplicationConfigBeanName) + .forEach(registry::removeBeanDefinition); + + beansNames = beanNamesForTypeIncludingAncestors(beanFactory, ApplicationConfig.class); + + if (beansNames.length > 1) { + throw new IllegalStateException(String.format("There are more than one instances of %s, whose bean definitions : %s", + ApplicationConfig.class.getSimpleName(), + Stream.of(beansNames) + .map(registry::getBeanDefinition) + .collect(Collectors.toList())) + ); + } + } + + private boolean isConfiguredApplicationConfigBeanName(String beanName) { + boolean removed = BeanFactoryUtils.isGeneratedBeanName(beanName) + // Dubbo ApplicationConfig id as bean name + || Objects.equals(beanName, environment.getProperty("dubbo.application.id")); + + if (removed) { + if (logger.isWarnEnabled()) { + logger.warn("The {} bean [ name : {} ] has been removed!", ApplicationConfig.class.getSimpleName(), beanName); + } + } + + return removed; + } + + + @Override + public int getOrder() { + return LOWEST_PRECEDENCE; + } +} diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/OverrideBeanDefinitionRegistryPostProcessor.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/OverrideBeanDefinitionRegistryPostProcessor.java new file mode 100644 index 000000000..164f081df --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/OverrideBeanDefinitionRegistryPostProcessor.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.beans.factory.config; + +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; + +import static org.apache.dubbo.config.spring.context.config.NamePropertyDefaultValueDubboConfigBeanCustomizer.BEAN_NAME; +import static org.apache.dubbo.config.spring.util.BeanRegistrar.registerInfrastructureBean; + +/** + * Override {@link BeanDefinitionRegistryPostProcessor} + * + * @since 2.7.1 + */ +public class OverrideBeanDefinitionRegistryPostProcessor implements BeanDefinitionRegistryPostProcessor { + + @Override + public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { + registerInfrastructureBean(registry, BEAN_NAME, DubboConfigBeanCustomizer.class); + } + + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { + } +} + diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java index 8b62c7516..939f17bae 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java @@ -16,25 +16,13 @@ */ package org.apache.dubbo.spring.boot.context; -import org.apache.dubbo.config.AbstractConfig; -import org.apache.dubbo.config.spring.context.config.NamePropertyDefaultValueDubboConfigBeanCustomizer; +import org.apache.dubbo.spring.boot.beans.factory.config.DubboConfigBeanDefinitionConflictProcessor; +import org.apache.dubbo.spring.boot.beans.factory.config.OverrideBeanDefinitionRegistryPostProcessor; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.core.Ordered; -import java.lang.reflect.Method; - -import static org.apache.dubbo.config.spring.context.config.NamePropertyDefaultValueDubboConfigBeanCustomizer.BEAN_NAME; -import static org.apache.dubbo.config.spring.util.BeanRegistrar.registerInfrastructureBean; -import static org.springframework.util.ReflectionUtils.findMethod; -import static org.springframework.util.ReflectionUtils.invokeMethod; - /** * Dubbo {@link ApplicationContextInitializer} implementation * @@ -50,6 +38,7 @@ public void initialize(ConfigurableApplicationContext applicationContext) { private void overrideBeanDefinitions(ConfigurableApplicationContext applicationContext) { applicationContext.addBeanFactoryPostProcessor(new OverrideBeanDefinitionRegistryPostProcessor()); + applicationContext.addBeanFactoryPostProcessor(new DubboConfigBeanDefinitionConflictProcessor()); } @Override @@ -57,50 +46,4 @@ public int getOrder() { return HIGHEST_PRECEDENCE; } - /** - * {@link BeanDefinitionRegistryPostProcessor} - */ - private static class OverrideBeanDefinitionRegistryPostProcessor implements BeanDefinitionRegistryPostProcessor { - - @Override - public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { - registerInfrastructureBean(registry, BEAN_NAME, DubboConfigBeanCustomizer.class); - } - - @Override - public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { - } - } - - /** - * Current implementation will be replaced {@link NamePropertyDefaultValueDubboConfigBeanCustomizer} in Dubbo 2.7.2 - */ - private static class DubboConfigBeanCustomizer extends NamePropertyDefaultValueDubboConfigBeanCustomizer { - @Override - public void customize(String beanName, AbstractConfig dubboConfigBean) { - boolean valid = isValidPropertyName(dubboConfigBean, beanName); - if (valid) { - super.customize(beanName, dubboConfigBean); - } - } - - private boolean isValidPropertyName(AbstractConfig dubboConfigBean, String propertyValue) { - boolean valid = true; - String propertyName = "name"; - // AbstractConfig.checkName(String,String) - Method method = findMethod(AbstractConfig.class, "checkName", String.class, String.class); - try { - if (!method.isAccessible()) { - method.setAccessible(true); - } - if (BeanUtils.getPropertyDescriptor(dubboConfigBean.getClass(), propertyName) != null) { - invokeMethod(method, null, propertyName, propertyValue); - } - } catch (IllegalStateException e) { - valid = false; - } - - return valid; - } - } } diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java index 09aa40a0b..a8546ecba 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java @@ -16,12 +16,7 @@ */ package org.apache.dubbo.spring.boot.env; -import org.apache.dubbo.config.ApplicationConfig; -import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig; -import org.apache.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; @@ -37,6 +32,11 @@ import java.util.Map; import java.util.Properties; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_APPLICATION_NAME_PROPERTY; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_APPLICATION_QOS_ENABLE_PROPERTY; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_CONFIG_MULTIPLE_PROPERTY; +import static org.apache.dubbo.spring.boot.util.DubboUtils.SPRING_APPLICATION_NAME_PROPERTY; + /** * The lowest precedence {@link EnvironmentPostProcessor} processes * {@link SpringApplication#setDefaultProperties(Properties) Spring Boot default properties} for Dubbo @@ -47,32 +47,7 @@ public class DubboDefaultPropertiesEnvironmentPostProcessor implements Environme /** * 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"; - - /** - * The property name of {@link EnableDubboConfig#multiple() @EnableDubboConfig.multiple()} - */ - private static final String DUBBO_CONFIG_MULTIPLE_PROPERTY = "dubbo.config.multiple"; - - /** - * The property name of {@link ApplicationConfig#getQosEnable() application's QOS enable} - */ - private static final String DUBBO_APPLICATION_QOS_ENABLE_PROPERTY = "dubbo.application.qos-enable"; + public static final String PROPERTY_SOURCE_NAME = "defaultProperties"; /** * The property name of "spring.main.allow-bean-definition-overriding". diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/DubboUtils.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/DubboUtils.java index 5b9fcd491..98b0bcdec 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/DubboUtils.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/DubboUtils.java @@ -16,8 +16,13 @@ */ package org.apache.dubbo.spring.boot.util; +import org.apache.dubbo.config.ApplicationConfig; import org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor; +import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig; +import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfigBinding; import org.apache.dubbo.config.spring.context.properties.DubboConfigBinder; + +import org.springframework.boot.context.ContextIdApplicationContextInitializer; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.PropertyResolver; @@ -126,6 +131,47 @@ public abstract class DubboUtils { */ public static final String BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME = "dubboScanBasePackagesPropertyResolver"; + /** + * The property name of Spring Application + * + * @see ContextIdApplicationContextInitializer + * @since 2.7.1 + */ + public static final String SPRING_APPLICATION_NAME_PROPERTY = "spring.application.name"; + + /** + * The property id of {@link ApplicationConfig} Bean + * + * @see EnableDubboConfig + * @see EnableDubboConfigBinding + * @since 2.7.1 + */ + public static final String DUBBO_APPLICATION_ID_PROPERTY = "dubbo.application.id"; + + /** + * The property name of {@link ApplicationConfig} + * + * @see EnableDubboConfig + * @see EnableDubboConfigBinding + * @since 2.7.1 + */ + public static final String DUBBO_APPLICATION_NAME_PROPERTY = "dubbo.application.name"; + + /** + * The property name of {@link ApplicationConfig#getQosEnable() application's QOS enable} + * + * @since 2.7.1 + */ + public static final String DUBBO_APPLICATION_QOS_ENABLE_PROPERTY = "dubbo.application.qos-enable"; + + /** + * The property name of {@link EnableDubboConfig#multiple() @EnableDubboConfig.multiple()} + * + * @since 2.7.1 + */ + public static final String DUBBO_CONFIG_MULTIPLE_PROPERTY = "dubbo.config.multiple"; + + /** * Filters Dubbo Properties from {@link ConfigurableEnvironment} * diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessorTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessorTest.java new file mode 100644 index 000000000..a24ca146a --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessorTest.java @@ -0,0 +1,109 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.beans.factory.config; + +import org.apache.dubbo.config.ApplicationConfig; +import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.ImportResource; +import org.springframework.context.annotation.PropertySource; +import org.springframework.core.Ordered; + +import java.util.Map; + + +/** + * {@link DubboConfigBeanDefinitionConflictProcessor} Test + * + * @since 2.7.1 + */ +public class DubboConfigBeanDefinitionConflictProcessorTest { + + private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); + + @Before + public void init() { + context.addBeanFactoryPostProcessor(new DubboConfigBeanDefinitionConflictProcessor()); + } + + @After + public void destroy() { + context.close(); + } + + @Test + public void testOrder() { + Assert.assertEquals(Ordered.LOWEST_PRECEDENCE, new DubboConfigBeanDefinitionConflictProcessor().getOrder()); + } + + @Test + public void testNormalCase() { + + System.setProperty("dubbo.application.name", "test-dubbo-application"); + + context.register(DubboConfig.class); + + context.refresh(); + + ApplicationConfig applicationConfig = context.getBean(ApplicationConfig.class); + + Assert.assertEquals("test-dubbo-application", applicationConfig.getName()); + } + + @Test + public void testDuplicatedConfigsCase() { + + context.register(PropertySourceConfig.class, DubboConfig.class); + + context.register(XmlConfig.class); + + context.refresh(); + + Map beansMap = context.getBeansOfType(ApplicationConfig.class); + + ApplicationConfig applicationConfig = beansMap.get("dubbo-consumer-2.7.x"); + + Assert.assertEquals(1, beansMap.size()); + + Assert.assertEquals("dubbo-consumer-2.7.x", applicationConfig.getName()); + } + + @Test(expected = IllegalStateException.class) + public void testFailedCase() { + context.register(ApplicationConfig.class); + testDuplicatedConfigsCase(); + } + + @EnableDubboConfig + static class DubboConfig { + + } + + @PropertySource("classpath:/META-INF/dubbo.properties") + static class PropertySourceConfig { + + } + + @ImportResource("classpath:/META-INF/spring/dubbo-context.xml") + static class XmlConfig { + } +} diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/DubboUtilsTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/DubboUtilsTest.java index 7242b58af..823ddb7db 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/DubboUtilsTest.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/DubboUtilsTest.java @@ -25,6 +25,10 @@ import static org.apache.dubbo.spring.boot.util.DubboUtils.BASE_PACKAGES_PROPERTY_NAME; import static org.apache.dubbo.spring.boot.util.DubboUtils.DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE; import static org.apache.dubbo.spring.boot.util.DubboUtils.DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_APPLICATION_ID_PROPERTY; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_APPLICATION_NAME_PROPERTY; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_APPLICATION_QOS_ENABLE_PROPERTY; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_CONFIG_MULTIPLE_PROPERTY; import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_CONFIG_PREFIX; import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_GITHUB_URL; import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_MAILING_LIST; @@ -35,6 +39,7 @@ import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_SPRING_BOOT_ISSUES_URL; import static org.apache.dubbo.spring.boot.util.DubboUtils.MULTIPLE_CONFIG_PROPERTY_NAME; import static org.apache.dubbo.spring.boot.util.DubboUtils.OVERRIDE_CONFIG_FULL_PROPERTY_NAME; +import static org.apache.dubbo.spring.boot.util.DubboUtils.SPRING_APPLICATION_NAME_PROPERTY; import static org.apache.dubbo.spring.boot.util.DubboUtils.filterDubboProperties; /** @@ -68,10 +73,17 @@ public void testConstants() { Assert.assertEquals("dev@dubbo.apache.org", DUBBO_MAILING_LIST); + Assert.assertEquals("spring.application.name", SPRING_APPLICATION_NAME_PROPERTY); + Assert.assertEquals("dubbo.application.id", DUBBO_APPLICATION_ID_PROPERTY); + Assert.assertEquals("dubbo.application.name", DUBBO_APPLICATION_NAME_PROPERTY); + Assert.assertEquals("dubbo.application.qos-enable", DUBBO_APPLICATION_QOS_ENABLE_PROPERTY); + Assert.assertEquals("dubbo.config.multiple", DUBBO_CONFIG_MULTIPLE_PROPERTY); + Assert.assertTrue(DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE); Assert.assertTrue(DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE); + } diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/dubbo.properties b/dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/dubbo.properties new file mode 100644 index 000000000..97633c54d --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/dubbo.properties @@ -0,0 +1 @@ +dubbo.application.id = test-dubbo-application-id \ No newline at end of file diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/spring/dubbo-context.xml b/dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/spring/dubbo-context.xml new file mode 100644 index 000000000..87b6505cf --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/spring/dubbo-context.xml @@ -0,0 +1,14 @@ + + + + + + + + \ No newline at end of file From fda8aca64ea400d5650cdbf4996c69ade9a43248 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Wed, 20 Mar 2019 16:10:59 +0800 Subject: [PATCH 40/46] Bugfix --- .../DubboAutoConfigurationOnMultipleConfigTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java index 1addb5e78..ba4e0a40d 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java @@ -23,6 +23,7 @@ import org.apache.dubbo.config.ProtocolConfig; import org.apache.dubbo.config.ProviderConfig; import org.apache.dubbo.config.RegistryConfig; + import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -49,7 +50,6 @@ @TestPropertySource( properties = { "dubbo.applications.application1.NAME = dubbo-demo-application", - "dubbo.applications.application2.name = dubbo-demo-application2", "dubbo.modules.module1.name = dubbo-demo-module", "dubbo.registries.registry1.address = zookeeper://192.168.99.100:32770", "dubbo.protocols.protocol1.name=dubbo", @@ -155,7 +155,7 @@ public class DubboAutoConfigurationOnMultipleConfigTest { public void testMultipleDubboConfigBindingProperties() { - Assert.assertEquals(3, applications.size()); + Assert.assertEquals(1, applications.size()); Assert.assertEquals(1, modules.size()); @@ -179,7 +179,7 @@ public void testApplicationContext() { */ Map applications = beansOfTypeIncludingAncestors(applicationContext, ApplicationConfig.class); - Assert.assertEquals(3, applications.size()); + Assert.assertEquals(1, applications.size()); /** * Multiple {@link ModuleConfig} From 25f0b03cf381c68113ab16c05abd23098f64d72c Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Wed, 20 Mar 2019 16:23:54 +0800 Subject: [PATCH 41/46] Update SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 95f09ae57..e8d9e32f9 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ 3.0.1 2.19.1 - 2.7.1 + 2.7.1-SNAPSHOT From a39ea23d8e4278b9cb8428862714609df1f5cd6c Mon Sep 17 00:00:00 2001 From: Mercy Ma Date: Wed, 20 Mar 2019 17:02:57 +0800 Subject: [PATCH 42/46] 2.7.x (#470) * Fix apache/incubator-dubbo-spring-boot-project#169 * 0.2.1 (#345) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * 0.2.1 (#346) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * 0.2.1 (#357) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * 0.2.1 (#360) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * 0.2.1 (#367) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * 0.2.1 (#372) (#374) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#378) * 0.2.1 (#372) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#376) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#389) * 0.2.1 (#372) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#376) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#386) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * Add NOTICE and DISCLAIMER * Remove spring.providers file from starter module (#403) (#404) * remove spring.providers file since it's only used by STS IDE * deep search in project, no useage * add @Override annotation (#409) * to method reference (#410) * add @Override annotation * modify method reference * Update README.md * Update README_CN.md * Update README_CN.md * Update README.md * Sync master to 0.2.x (#417) * 0.2.1 release (#402) * 0.2.1 (#345) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * 0.2.1 (#346) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * 0.2.1 (#357) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * 0.2.1 (#360) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * 0.2.1 (#367) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * 0.2.1 (#372) (#374) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#378) * 0.2.1 (#372) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#376) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#389) * 0.2.1 (#372) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#376) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#386) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * Add NOTICE and DISCLAIMER * Add Java11 support #383 (#393) * Upgrade jacoco to version 0.8.2 #383 * Update travis setting add openjdk11 remove openjdk10 openjdk9 * Update mailing list address (#380) * Update README [user guide] link (#348) * Remove spring.providers file from starter module (#403) (#404) * remove spring.providers file since it's only used by STS IDE * deep search in project, no useage * add @Override annotation (#409) * to method reference (#410) * add @Override annotation * modify method reference * Update README.md * Update README_CN.md * Update README_CN.md * Update README.md * Update README.md * Update README_CN.md * Replace ${project.version} to ${revision} in the "pom.xml" files * Update * Update README.md * Update README_CN.md * 0.2.x (#422) * Sync master to 0.2.x (#417) * 0.2.1 release (#402) * 0.2.1 (#345) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * 0.2.1 (#346) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * 0.2.1 (#357) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * 0.2.1 (#360) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * 0.2.1 (#367) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * 0.2.1 (#372) (#374) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#378) * 0.2.1 (#372) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#376) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#389) * 0.2.1 (#372) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#376) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * 0.2.1 (#386) * Fix apache/incubator-dubbo-spring-boot-project#169 * Polish : apache/incubator-dubbo-spring-boot-project#324 & apache/incubator-dubbo-spring-boot-project#325 * Polish : apache/incubator-dubbo-spring-boot-project#315 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 * Polish : apache/incubator-dubbo-spring-boot-project#321 for test case * Polish : Update Demos * Polish : Update version to be 0.2.1 * Polish : apache/incubator-dubbo-spring-boot-project#319 * Polish : apache/incubator-dubbo-spring-boot-project#226 * Polish : apache/incubator-dubbo-spring-boot-project#309 * Fix the test case's bugs * Fix the test case's bugs * Fix a JavaDoc issue * Update SNAPSHOT and add exclude list * Update SNAPSHOT to be 0.2.1-SNAPSHOT * Update JDK versions * Update JDK versions * Reactor & remove author info * Refactor : to save a shutdown hook thread * Remove javax.servlet:javax.servlet-api:3.1.0 that may cause class conflict, and use indirectly dependencies from spring-boot-starter-* * Polish apache/incubator-dubbo-spring-boot-project#341 * Add the samples * Add a license * Add the samples of Zookeeper and Nacos * Update README.md * Fix the test cases * Polish apache/incubator-dubbo-spring-boot-project#366 * Polish apache/incubator-dubbo-spring-boot-project#370 * Polish apache/incubator-dubbo-spring-boot-project#370 * Add NOTICE and DISCLAIMER * Add Java11 support #383 (#393) * Upgrade jacoco to version 0.8.2 #383 * Update travis setting add openjdk11 remove openjdk10 openjdk9 * Update mailing list address (#380) * Update README [user guide] link (#348) * Remove spring.providers file from starter module (#403) (#404) * remove spring.providers file since it's only used by STS IDE * deep search in project, no useage * add @Override annotation (#409) * to method reference (#410) * add @Override annotation * modify method reference * Update README.md * Update README_CN.md * Update README_CN.md * Update README.md * Replace ${project.version} to ${revision} in the "pom.xml" files * Update * 1.0.0 (#429) * Polish apache/incubator-dubbo-spring-boot-project#395 * Polish apache/incubator-dubbo-spring-boot-project#395 fixed issues * Polish apache/incubator-dubbo-spring-boot-project#395 Update documents * Update the root POM's parent * Replace ${project.version} to ${revision} in the "pom.xml" files * Update * Remove Netty Project * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * 1.0.0 (#431) * Polish apache/incubator-dubbo-spring-boot-project#395 * Polish apache/incubator-dubbo-spring-boot-project#395 fixed issues * Polish apache/incubator-dubbo-spring-boot-project#395 Update documents * Update the root POM's parent * Replace ${project.version} to ${revision} in the "pom.xml" files * Update * Remove Netty Project * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 : Update Documents * 2.7.0 (#433) * Polish apache/incubator-dubbo-spring-boot-project#395 * Polish apache/incubator-dubbo-spring-boot-project#395 fixed issues * Polish apache/incubator-dubbo-spring-boot-project#395 Update documents * Update the root POM's parent * Replace ${project.version} to ${revision} in the "pom.xml" files * Update * Remove Netty Project * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 : Update Documents * Polish : apache/incubator-dubbo-spring-boot-project#427 : Fixed include pattern * 1.0.0 (#435) * Polish apache/incubator-dubbo-spring-boot-project#395 * Polish apache/incubator-dubbo-spring-boot-project#395 fixed issues * Polish apache/incubator-dubbo-spring-boot-project#395 Update documents * Update the root POM's parent * Replace ${project.version} to ${revision} in the "pom.xml" files * Update * Remove Netty Project * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 * Polish : apache/incubator-dubbo-spring-boot-project#427 : Update Documents * Polish : apache/incubator-dubbo-spring-boot-project#427 : Fixed include pattern * Polish : apache/incubator-dubbo-spring-boot-project#427 : Correct words * Update README.md (#445) * Fix typo (#446) * Move png files to subfolder (#448) * Enable flatten plugin by default (#441) (#443) * Polish apache/incubator-dubbo-spring-boot-project#449 * Polish apache/incubator-dubbo-spring-boot-project#467 : Set "spring.main.allow-bean-definition-overriding" property to be true as default * Polish apache/incubator-dubbo-spring-boot-project#468 : Upgrade Dubbo 2.7.1 * Polish apache/incubator-dubbo-spring-boot-project#437 : Remove -XX:PermSize=64m -XX:MaxPermSize=128m * Fix the issues of test cases * Update Samples * Update default version using Dubbo's version * Polish apache/incubator-dubbo-spring-boot-project#456 : Update the Zookeeper dependencies * Polish apache/incubator-dubbo-spring-boot-project#458 : dubbo.metadata-report.address propertie description not provided * Polish apache/incubator-dubbo-spring-boot-project#458 : dubbo.metadata-report.address propertie description not provided * Update 2.7.1 * Polish apache/incubator-dubbo-spring-boot-project#458 : Add "override" property * Polish apache/incubator-dubbo-spring-boot-project#451 : Duplicate application configs * Bugfix * Update SNAPSHOT --- README.md | 8 +- README_CN.md | 4 +- dubbo-spring-boot-actuator/README.md | 6 +- dubbo-spring-boot-actuator/pom.xml | 7 - ...dpointAnnotationAutoConfigurationTest.java | 7 +- dubbo-spring-boot-autoconfigure/README.md | 6 +- .../config-popup-window.png | Bin .../mconfig-popup-window.png | Bin dubbo-spring-boot-autoconfigure/pom.xml | 7 - .../DelegatingPropertyResolver.java | 83 ++ ...DubboRelaxedBinding2AutoConfiguration.java | 2 +- ...oRelaxedBinding2AutoConfigurationTest.java | 16 + .../DubboEndpointAutoConfiguration.java | 3 + .../DubboEndpointAutoConfigurationTest.java | 7 +- .../autoconfigure/DubboAutoConfiguration.java | 8 +- .../DubboConfigurationProperties.java | 300 +++++ .../config/DubboConfigBeanCustomizer.java | 65 + ...ConfigBeanDefinitionConflictProcessor.java | 120 ++ ...deBeanDefinitionRegistryPostProcessor.java | 43 + .../DubboApplicationContextInitializer.java | 49 + .../event/WelcomeLogoApplicationListener.java | 3 +- ...ultPropertiesEnvironmentPostProcessor.java | 49 +- .../dubbo/spring/boot/util/DubboUtils.java | 46 + .../spring-configuration-metadata.json | 1098 ----------------- .../main/resources/META-INF/spring.factories | 4 +- ...AutoConfigurationOnMultipleConfigTest.java | 6 +- ...igBeanDefinitionConflictProcessorTest.java | 109 ++ .../spring/boot/util/DubboUtilsTest.java | 12 + .../test/resources/META-INF/dubbo.properties | 1 + .../META-INF/spring/dubbo-context.xml | 14 + dubbo-spring-boot-parent/pom.xml | 10 +- ...bboAutoConfigurationConsumerBootstrap.java | 4 +- .../provider/service/DefaultDemoService.java | 1 + .../consumer-sample/pom.xml | 17 +- ...bboRegistryZooKeeperConsumerBootstrap.java | 5 +- .../src/main/resources/application.yml | 3 +- .../provider-sample/pom.xml | 18 +- .../provider/bootstrap/EmbeddedZooKeeper.java | 1 + .../provider/service/DefaultDemoService.java | 1 + .../src/main/resources/application.properties | 1 + ...nalizedConfigurationConsumerBootstrap.java | 4 +- .../provider/service/DefaultDemoService.java | 1 + pom.xml | 35 +- 43 files changed, 976 insertions(+), 1208 deletions(-) rename config-popup-window.png => dubbo-spring-boot-autoconfigure/config-popup-window.png (100%) rename mconfig-popup-window.png => dubbo-spring-boot-autoconfigure/mconfig-popup-window.png (100%) create mode 100644 dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DelegatingPropertyResolver.java create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanCustomizer.java create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessor.java create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/OverrideBeanDefinitionRegistryPostProcessor.java create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java delete mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessorTest.java create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/dubbo.properties create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/spring/dubbo-context.xml diff --git a/README.md b/README.md index 60cfbb8a6..f59b98a98 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![codecov](https://codecov.io/gh/apache/incubator-dubbo-spring-boot-project/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/incubator-dubbo-spring-boot-project) ![license](https://img.shields.io/github/license/apache/incubator-dubbo-spring-boot-project.svg) -[Apache Dubbo(incubating)](https://github.com/apache/incubator-dubbo) Spring Boot Project makes it easy to create [Spring Boot](https://github.com/spring-projects/spring-boot/) application using Dubbo as RPC Framework. What's more, it aslo provides +[Apache Dubbo(incubating)](https://github.com/apache/incubator-dubbo) Spring Boot Project makes it easy to create [Spring Boot](https://github.com/spring-projects/spring-boot/) application using Dubbo as RPC Framework. What's more, it also provides * [auto-configure features](dubbo-spring-boot-autoconfigure) (e.g., annotation-driven, auto configuration, externalized configuration). * [production-ready features](dubbo-spring-boot-actuator) (e.g., security, health checks, externalized configuration). @@ -20,7 +20,7 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by addi ```xml 2.1.1.RELEASE - 2.7.0 + 2.7.1 @@ -34,7 +34,7 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by addi import - + org.apache.dubbo dubbo-dependencies-bom @@ -70,7 +70,7 @@ You can introduce the latest `dubbo-spring-boot-starter` to your project by addi org.apache.dubbo dubbo-spring-boot-starter - 2.7.0 + 2.7.1 diff --git a/README_CN.md b/README_CN.md index 56187debc..0ad05b862 100644 --- a/README_CN.md +++ b/README_CN.md @@ -22,7 +22,7 @@ ```xml 2.1.1.RELEASE - 2.7.0 + 2.7.1 @@ -72,7 +72,7 @@ org.apache.dubbo dubbo-spring-boot-starter - 2.7.0 + 2.7.1 diff --git a/dubbo-spring-boot-actuator/README.md b/dubbo-spring-boot-actuator/README.md index ec743c619..659006c75 100644 --- a/dubbo-spring-boot-actuator/README.md +++ b/dubbo-spring-boot-actuator/README.md @@ -22,7 +22,7 @@ You can introduce the latest `dubbo-spring-boot-actuator` to your project by ad org.apache.dubbo dubbo-spring-boot-actuator - 2.7.0 + 2.7.1 ``` @@ -171,8 +171,8 @@ Actuator endpoint `dubbo` supports Actuator Endpoints : { "timestamp": 1516623290166, "versions": { - "dubbo-spring-boot": "2.7.0", - "dubbo": "2.7.0" + "dubbo-spring-boot": "2.7.1", + "dubbo": "2.7.1" }, "urls": { "dubbo": "https://github.com/apache/incubator-dubbo/", diff --git a/dubbo-spring-boot-actuator/pom.xml b/dubbo-spring-boot-actuator/pom.xml index ef7eed38c..bf905f1bf 100644 --- a/dubbo-spring-boot-actuator/pom.xml +++ b/dubbo-spring-boot-actuator/pom.xml @@ -58,13 +58,6 @@ true - - - org.springframework.boot - spring-boot-configuration-processor - true - - org.apache.dubbo diff --git a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java b/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java index d9747cc08..954ad7a9a 100644 --- a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java +++ b/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java @@ -16,8 +16,6 @@ */ package org.apache.dubbo.spring.boot.actuate.autoconfigure; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.dubbo.config.annotation.Service; import org.apache.dubbo.spring.boot.actuate.endpoint.DubboConfigsMetadataEndpoint; import org.apache.dubbo.spring.boot.actuate.endpoint.DubboMetadataEndpoint; @@ -25,6 +23,9 @@ import org.apache.dubbo.spring.boot.actuate.endpoint.DubboReferencesMetadataEndpoint; import org.apache.dubbo.spring.boot.actuate.endpoint.DubboServicesMetadataEndpoint; import org.apache.dubbo.spring.boot.actuate.endpoint.DubboShutdownEndpoint; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -159,7 +160,7 @@ public void testServices() { Assert.assertEquals(1, services.size()); - Map demoServiceMeta = services.get("ServiceBean:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAnnotationAutoConfigurationTest$DemoService:1.0.0"); + Map demoServiceMeta = services.get("providers:my-protocol:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAnnotationAutoConfigurationTest$DemoService:1.0.0"); Assert.assertEquals("1.0.0", demoServiceMeta.get("version")); diff --git a/dubbo-spring-boot-autoconfigure/README.md b/dubbo-spring-boot-autoconfigure/README.md index 0e32d7ab3..ac33ef440 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 org.apache.dubbo dubbo-spring-boot-autoconfigure - 2.7.0 + 2.7.1 ``` @@ -213,13 +213,13 @@ If you used advanced IDE tools , for instance [Jetbrains IDEA Ultimate](https:// #### Case 1 - Single Bindings -![](../config-popup-window.png) +![](config-popup-window.png) #### Case 2 - Mutiple Bindings -![](../mconfig-popup-window.png) +![](mconfig-popup-window.png) ​ diff --git a/config-popup-window.png b/dubbo-spring-boot-autoconfigure/config-popup-window.png similarity index 100% rename from config-popup-window.png rename to dubbo-spring-boot-autoconfigure/config-popup-window.png diff --git a/mconfig-popup-window.png b/dubbo-spring-boot-autoconfigure/mconfig-popup-window.png similarity index 100% rename from mconfig-popup-window.png rename to dubbo-spring-boot-autoconfigure/mconfig-popup-window.png diff --git a/dubbo-spring-boot-autoconfigure/pom.xml b/dubbo-spring-boot-autoconfigure/pom.xml index 83f1a4b29..190bfdb9d 100644 --- a/dubbo-spring-boot-autoconfigure/pom.xml +++ b/dubbo-spring-boot-autoconfigure/pom.xml @@ -54,13 +54,6 @@ true - - - org.springframework.boot - spring-boot-configuration-processor - true - - org.apache.dubbo diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DelegatingPropertyResolver.java b/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DelegatingPropertyResolver.java new file mode 100644 index 000000000..b36d921d6 --- /dev/null +++ b/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DelegatingPropertyResolver.java @@ -0,0 +1,83 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.autoconfigure; + +import org.apache.dubbo.common.utils.Assert; +import org.springframework.core.env.PropertyResolver; +import org.springframework.lang.Nullable; + +/** + * Delegating {@link PropertyResolver} + * + * @since 2.7.1 + */ +class DelegatingPropertyResolver implements PropertyResolver { + + private final PropertyResolver delegate; + + DelegatingPropertyResolver(PropertyResolver delegate) { + Assert.notNull(delegate, "The delegate of PropertyResolver must not be null"); + this.delegate = delegate; + } + + @Override + public boolean containsProperty(String key) { + return delegate.containsProperty(key); + } + + @Override + @Nullable + public String getProperty(String key) { + return delegate.getProperty(key); + } + + @Override + public String getProperty(String key, String defaultValue) { + return delegate.getProperty(key, defaultValue); + } + + @Override + @Nullable + public T getProperty(String key, Class targetType) { + return delegate.getProperty(key, targetType); + } + + @Override + public T getProperty(String key, Class targetType, T defaultValue) { + return delegate.getProperty(key, targetType, defaultValue); + } + + @Override + public String getRequiredProperty(String key) throws IllegalStateException { + return delegate.getRequiredProperty(key); + } + + @Override + public T getRequiredProperty(String key, Class targetType) throws IllegalStateException { + return delegate.getRequiredProperty(key, targetType); + } + + @Override + public String resolvePlaceholders(String text) { + return delegate.resolvePlaceholders(text); + } + + @Override + public String resolveRequiredPlaceholders(String text) throws IllegalArgumentException { + return delegate.resolveRequiredPlaceholders(text); + } +} diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java b/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java index 97aa275f2..2b572731c 100644 --- a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java +++ b/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java @@ -61,7 +61,7 @@ protected void customizePropertySources(MutablePropertySources propertySources) } }; ConfigurationPropertySources.attach(propertyResolver); - return propertyResolver; + return new DelegatingPropertyResolver(propertyResolver); } @ConditionalOnMissingBean(name = RELAXED_DUBBO_CONFIG_BINDER_BEAN_NAME, value = DubboConfigBinder.class) diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfigurationTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfigurationTest.java index 4aee5a50d..bc354dc71 100644 --- a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfigurationTest.java +++ b/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfigurationTest.java @@ -27,10 +27,13 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.core.env.Environment; import org.springframework.core.env.PropertyResolver; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.ClassUtils; +import java.util.Collection; + import static org.apache.dubbo.spring.boot.util.DubboUtils.BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME; import static org.apache.dubbo.spring.boot.util.DubboUtils.RELAXED_DUBBO_CONFIG_BINDER_BEAN_NAME; @@ -58,6 +61,12 @@ public class DubboRelaxedBinding2AutoConfigurationTest { @Autowired private ObjectProvider referenceAnnotationBeanPostProcessor; + @Autowired + private Environment environment; + + @Autowired + private Collection environments; + @Test public void testBeans() { Assert.assertTrue(ClassUtils.isAssignableValue(BinderDubboConfigBinder.class, dubboConfigBinder)); @@ -65,6 +74,13 @@ public void testBeans() { Assert.assertNotNull(serviceAnnotationBeanPostProcessor.getIfAvailable()); Assert.assertNotNull(referenceAnnotationBeanPostProcessor); Assert.assertNotNull(referenceAnnotationBeanPostProcessor.getIfAvailable()); + + Assert.assertNotNull(environment); + Assert.assertNotNull(environments); + + Assert.assertEquals(1, environments.size()); + + Assert.assertTrue(environments.contains(environment)); } } diff --git a/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfiguration.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfiguration.java index a74cab1f0..92a9ba0aa 100644 --- a/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfiguration.java +++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfiguration.java @@ -20,11 +20,13 @@ import org.apache.dubbo.spring.boot.actuate.endpoint.DubboEndpoint; import org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration; import org.apache.dubbo.spring.boot.autoconfigure.DubboRelaxedBindingAutoConfiguration; + import org.springframework.boot.actuate.condition.ConditionalOnEnabledEndpoint; import org.springframework.boot.actuate.endpoint.Endpoint; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -41,6 +43,7 @@ DubboAutoConfiguration.class, DubboRelaxedBindingAutoConfiguration.class }) +@EnableConfigurationProperties(DubboEndpoint.class) public class DubboEndpointAutoConfiguration { @Bean diff --git a/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java b/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java index 9f5f51ec5..3227723a8 100644 --- a/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java +++ b/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java @@ -16,8 +16,6 @@ */ package org.apache.dubbo.spring.boot.actuate.autoconfigure; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.dubbo.config.annotation.Service; import org.apache.dubbo.spring.boot.actuate.endpoint.DubboEndpoint; import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboConfigsMetadata; @@ -25,6 +23,9 @@ import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboReferencesMetadata; import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboServicesMetadata; import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboShutdownMetadata; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -163,7 +164,7 @@ public void testServices() { Assert.assertEquals(1, services.size()); - Map demoServiceMeta = services.get("ServiceBean:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAutoConfigurationTest$DemoService:1.0.0"); + Map demoServiceMeta = services.get("providers:my-protocol:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAutoConfigurationTest$DemoService:1.0.0"); Assert.assertEquals("1.0.0", demoServiceMeta.get("version")); diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java index f49e49e41..059a3e6a2 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java @@ -22,13 +22,16 @@ import org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor; import org.apache.dubbo.config.spring.context.annotation.DubboConfigConfiguration; import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig; + import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.core.env.PropertyResolver; import java.util.Set; @@ -53,6 +56,7 @@ @ConditionalOnProperty(prefix = DUBBO_PREFIX, name = "enabled", matchIfMissing = true) @Configuration @AutoConfigureAfter(DubboRelaxedBindingAutoConfiguration.class) +@EnableConfigurationProperties(DubboConfigurationProperties.class) public class DubboAutoConfiguration { /** @@ -87,7 +91,7 @@ public ReferenceAnnotationBeanPostProcessor referenceAnnotationBeanPostProcessor * @see EnableDubboConfig * @see DubboConfigConfiguration.Single */ - @EnableDubboConfig + @Import(DubboConfigConfiguration.Single.class) protected static class SingleDubboConfigConfiguration { } @@ -98,7 +102,7 @@ protected static class SingleDubboConfigConfiguration { * @see DubboConfigConfiguration.Multiple */ @ConditionalOnProperty(prefix = DUBBO_CONFIG_PREFIX, name = MULTIPLE_CONFIG_PROPERTY_NAME, matchIfMissing = true) - @EnableDubboConfig(multiple = true) + @Import(DubboConfigConfiguration.Multiple.class) protected static class MultipleDubboConfigConfiguration { } diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java new file mode 100644 index 000000000..495c152ff --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java @@ -0,0 +1,300 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.autoconfigure; + +import org.apache.dubbo.config.ApplicationConfig; +import org.apache.dubbo.config.ConsumerConfig; +import org.apache.dubbo.config.MetadataReportConfig; +import org.apache.dubbo.config.ModuleConfig; +import org.apache.dubbo.config.MonitorConfig; +import org.apache.dubbo.config.ProtocolConfig; +import org.apache.dubbo.config.ProviderConfig; +import org.apache.dubbo.config.RegistryConfig; +import org.apache.dubbo.config.spring.ConfigCenterBean; +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; + +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; + +import static org.apache.dubbo.spring.boot.util.DubboUtils.DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_PREFIX; + +/** + * Dubbo {@link ConfigurationProperties Config Properties} only used to generate JSON metadata(non-public class) + * + * @since 2.7.1 + */ +@ConfigurationProperties(DUBBO_PREFIX) +class DubboConfigurationProperties { + + @NestedConfigurationProperty + private Config config = new Config(); + + @NestedConfigurationProperty + private Scan scan = new Scan(); + + // Single Config Bindings + @NestedConfigurationProperty + private ApplicationConfig application = new ApplicationConfig(); + + @NestedConfigurationProperty + private ModuleConfig module = new ModuleConfig(); + + @NestedConfigurationProperty + private RegistryConfig registry = new RegistryConfig(); + + @NestedConfigurationProperty + private ProtocolConfig protocol = new ProtocolConfig(); + + @NestedConfigurationProperty + private MonitorConfig monitor = new MonitorConfig(); + + @NestedConfigurationProperty + private ProviderConfig provider = new ProviderConfig(); + + @NestedConfigurationProperty + private ConsumerConfig consumer = new ConsumerConfig(); + + @NestedConfigurationProperty + private ConfigCenterBean configCenter = new ConfigCenterBean(); + + @NestedConfigurationProperty + private MetadataReportConfig metadataReport = new MetadataReportConfig(); + + // Multiple Config Bindings + + private Map modules = new LinkedHashMap<>(); + + private Map registrys = new LinkedHashMap<>(); + + private Map protocols = new LinkedHashMap<>(); + + private Map monitors = new LinkedHashMap<>(); + + private Map providers = new LinkedHashMap<>(); + + private Map consumers = new LinkedHashMap<>(); + + private Map configCenters = new LinkedHashMap<>(); + + private Map metadataReports = new LinkedHashMap<>(); + + public Config getConfig() { + return config; + } + + public void setConfig(Config config) { + this.config = config; + } + + public Scan getScan() { + return scan; + } + + public void setScan(Scan scan) { + this.scan = scan; + } + + public ApplicationConfig getApplication() { + return application; + } + + public void setApplication(ApplicationConfig application) { + this.application = application; + } + + public ModuleConfig getModule() { + return module; + } + + public void setModule(ModuleConfig module) { + this.module = module; + } + + public RegistryConfig getRegistry() { + return registry; + } + + public void setRegistry(RegistryConfig registry) { + this.registry = registry; + } + + public ProtocolConfig getProtocol() { + return protocol; + } + + public void setProtocol(ProtocolConfig protocol) { + this.protocol = protocol; + } + + public MonitorConfig getMonitor() { + return monitor; + } + + public void setMonitor(MonitorConfig monitor) { + this.monitor = monitor; + } + + public ProviderConfig getProvider() { + return provider; + } + + public void setProvider(ProviderConfig provider) { + this.provider = provider; + } + + public ConsumerConfig getConsumer() { + return consumer; + } + + public void setConsumer(ConsumerConfig consumer) { + this.consumer = consumer; + } + + public ConfigCenterBean getConfigCenter() { + return configCenter; + } + + public void setConfigCenter(ConfigCenterBean configCenter) { + this.configCenter = configCenter; + } + + public MetadataReportConfig getMetadataReport() { + return metadataReport; + } + + public void setMetadataReport(MetadataReportConfig metadataReport) { + this.metadataReport = metadataReport; + } + + public Map getModules() { + return modules; + } + + public void setModules(Map modules) { + this.modules = modules; + } + + public Map getRegistrys() { + return registrys; + } + + public void setRegistrys(Map registrys) { + this.registrys = registrys; + } + + public Map getProtocols() { + return protocols; + } + + public void setProtocols(Map protocols) { + this.protocols = protocols; + } + + public Map getMonitors() { + return monitors; + } + + public void setMonitors(Map monitors) { + this.monitors = monitors; + } + + public Map getProviders() { + return providers; + } + + public void setProviders(Map providers) { + this.providers = providers; + } + + public Map getConsumers() { + return consumers; + } + + public void setConsumers(Map consumers) { + this.consumers = consumers; + } + + public Map getConfigCenters() { + return configCenters; + } + + public void setConfigCenters(Map configCenters) { + this.configCenters = configCenters; + } + + public Map getMetadataReports() { + return metadataReports; + } + + public void setMetadataReports(Map metadataReports) { + this.metadataReports = metadataReports; + } + + static class Config { + + /** + * Indicates multiple properties binding from externalized configuration or not. + */ + private boolean multiple = DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE; + + /** + * The property name of override Dubbo config + */ + private boolean override = DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE; + + public boolean isOverride() { + return override; + } + + public void setOverride(boolean override) { + this.override = override; + } + + public boolean isMultiple() { + return multiple; + } + + public void setMultiple(boolean multiple) { + this.multiple = multiple; + } + } + + static class Scan { + + /** + * The basePackages to scan , the multiple-value is delimited by comma + * + * @see EnableDubbo#scanBasePackages() + */ + private Set basePackages = new LinkedHashSet<>(); + + public Set getBasePackages() { + return basePackages; + } + + public void setBasePackages(Set basePackages) { + this.basePackages = basePackages; + } + } +} diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanCustomizer.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanCustomizer.java new file mode 100644 index 000000000..518aed829 --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanCustomizer.java @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.beans.factory.config; + +import org.apache.dubbo.config.AbstractConfig; +import org.apache.dubbo.config.spring.context.config.NamePropertyDefaultValueDubboConfigBeanCustomizer; + +import org.springframework.beans.BeanUtils; + +import java.lang.reflect.Method; + +import static org.springframework.util.ReflectionUtils.findMethod; +import static org.springframework.util.ReflectionUtils.invokeMethod; + + +/** + * Current implementation will be replaced {@link NamePropertyDefaultValueDubboConfigBeanCustomizer} in Dubbo 2.7.2 + * + * @since 2.7.1 + * @deprecated + */ +@Deprecated +class DubboConfigBeanCustomizer extends NamePropertyDefaultValueDubboConfigBeanCustomizer { + + @Override + public void customize(String beanName, AbstractConfig dubboConfigBean) { + boolean valid = isValidPropertyName(dubboConfigBean, beanName); + if (valid) { + super.customize(beanName, dubboConfigBean); + } + } + + private boolean isValidPropertyName(AbstractConfig dubboConfigBean, String propertyValue) { + boolean valid = true; + String propertyName = "name"; + // AbstractConfig.checkName(String,String) + Method method = findMethod(AbstractConfig.class, "checkName", String.class, String.class); + try { + if (!method.isAccessible()) { + method.setAccessible(true); + } + if (BeanUtils.getPropertyDescriptor(dubboConfigBean.getClass(), propertyName) != null) { + invokeMethod(method, null, propertyName, propertyValue); + } + } catch (IllegalStateException e) { + valid = false; + } + + return valid; + } +} diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessor.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessor.java new file mode 100644 index 000000000..807610186 --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessor.java @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.beans.factory.config; + +import org.apache.dubbo.config.ApplicationConfig; +import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.BeanFactoryUtils; +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; +import org.springframework.core.Ordered; +import org.springframework.core.env.Environment; + +import java.util.Objects; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors; +import static org.springframework.context.ConfigurableApplicationContext.ENVIRONMENT_BEAN_NAME; + +/** + * Dubbo Config {@link BeanDefinition Bean Definition} {@link BeanDefinitionRegistryPostProcessor processor} + * to resolve conflict + * + * @see BeanDefinition + * @see BeanDefinitionRegistryPostProcessor + * @since 2.7.1 + */ +public class DubboConfigBeanDefinitionConflictProcessor implements BeanDefinitionRegistryPostProcessor, Ordered { + + private final Logger logger = LoggerFactory.getLogger(getClass()); + + private BeanDefinitionRegistry registry; + + private Environment environment; + + @Override + public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { + this.registry = registry; + } + + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { + resolveUniqueApplicationConfigBean(registry, beanFactory); + } + + /** + * Resolve the unique {@link ApplicationConfig} Bean + * + * @param registry {@link BeanDefinitionRegistry} instance + * @param beanFactory {@link ConfigurableListableBeanFactory} instance + * @see EnableDubboConfig + */ + private void resolveUniqueApplicationConfigBean(BeanDefinitionRegistry registry, + ConfigurableListableBeanFactory beanFactory) { + + this.environment = beanFactory.getBean(ENVIRONMENT_BEAN_NAME, Environment.class); + + String[] beansNames = beanNamesForTypeIncludingAncestors(beanFactory, ApplicationConfig.class); + + if (beansNames.length < 2) { // If the number of ApplicationConfig beans is less than two, return immediately. + return; + } + + // Remove ApplicationConfig Beans that are configured by "dubbo.application.*" + Stream.of(beansNames) + .filter(this::isConfiguredApplicationConfigBeanName) + .forEach(registry::removeBeanDefinition); + + beansNames = beanNamesForTypeIncludingAncestors(beanFactory, ApplicationConfig.class); + + if (beansNames.length > 1) { + throw new IllegalStateException(String.format("There are more than one instances of %s, whose bean definitions : %s", + ApplicationConfig.class.getSimpleName(), + Stream.of(beansNames) + .map(registry::getBeanDefinition) + .collect(Collectors.toList())) + ); + } + } + + private boolean isConfiguredApplicationConfigBeanName(String beanName) { + boolean removed = BeanFactoryUtils.isGeneratedBeanName(beanName) + // Dubbo ApplicationConfig id as bean name + || Objects.equals(beanName, environment.getProperty("dubbo.application.id")); + + if (removed) { + if (logger.isWarnEnabled()) { + logger.warn("The {} bean [ name : {} ] has been removed!", ApplicationConfig.class.getSimpleName(), beanName); + } + } + + return removed; + } + + + @Override + public int getOrder() { + return LOWEST_PRECEDENCE; + } +} diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/OverrideBeanDefinitionRegistryPostProcessor.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/OverrideBeanDefinitionRegistryPostProcessor.java new file mode 100644 index 000000000..164f081df --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/beans/factory/config/OverrideBeanDefinitionRegistryPostProcessor.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.beans.factory.config; + +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; + +import static org.apache.dubbo.config.spring.context.config.NamePropertyDefaultValueDubboConfigBeanCustomizer.BEAN_NAME; +import static org.apache.dubbo.config.spring.util.BeanRegistrar.registerInfrastructureBean; + +/** + * Override {@link BeanDefinitionRegistryPostProcessor} + * + * @since 2.7.1 + */ +public class OverrideBeanDefinitionRegistryPostProcessor implements BeanDefinitionRegistryPostProcessor { + + @Override + public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { + registerInfrastructureBean(registry, BEAN_NAME, DubboConfigBeanCustomizer.class); + } + + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { + } +} + diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java new file mode 100644 index 000000000..939f17bae --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.context; + +import org.apache.dubbo.spring.boot.beans.factory.config.DubboConfigBeanDefinitionConflictProcessor; +import org.apache.dubbo.spring.boot.beans.factory.config.OverrideBeanDefinitionRegistryPostProcessor; + +import org.springframework.context.ApplicationContextInitializer; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.Ordered; + +/** + * Dubbo {@link ApplicationContextInitializer} implementation + * + * @see ApplicationContextInitializer + * @since 2.7.1 + */ +public class DubboApplicationContextInitializer implements ApplicationContextInitializer, Ordered { + + @Override + public void initialize(ConfigurableApplicationContext applicationContext) { + overrideBeanDefinitions(applicationContext); + } + + private void overrideBeanDefinitions(ConfigurableApplicationContext applicationContext) { + applicationContext.addBeanFactoryPostProcessor(new OverrideBeanDefinitionRegistryPostProcessor()); + applicationContext.addBeanFactoryPostProcessor(new DubboConfigBeanDefinitionConflictProcessor()); + } + + @Override + public int getOrder() { + return HIGHEST_PRECEDENCE; + } + +} diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListener.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListener.java index f053227ff..05c8a5de8 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListener.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListener.java @@ -17,6 +17,7 @@ package org.apache.dubbo.spring.boot.context.event; import org.apache.dubbo.common.Version; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; @@ -75,7 +76,7 @@ String buildBannerText() { bannerTextBuilder .append(LINE_SEPARATOR) .append(LINE_SEPARATOR) - .append(" :: Dubbo Spring Boot (v").append(Version.getVersion(getClass(), "1.0.0")).append(") : ") + .append(" :: Dubbo Spring Boot (v").append(Version.getVersion(getClass(), Version.getVersion())).append(") : ") .append(DUBBO_SPRING_BOOT_GITHUB_URL) .append(LINE_SEPARATOR) .append(" :: Dubbo (v").append(Version.getVersion()).append(") : ") diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java index 0efbc6b48..a8546ecba 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java @@ -16,11 +16,7 @@ */ package org.apache.dubbo.spring.boot.env; -import org.apache.dubbo.config.ApplicationConfig; -import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig; -import org.apache.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; @@ -36,6 +32,11 @@ import java.util.Map; import java.util.Properties; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_APPLICATION_NAME_PROPERTY; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_APPLICATION_QOS_ENABLE_PROPERTY; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_CONFIG_MULTIPLE_PROPERTY; +import static org.apache.dubbo.spring.boot.util.DubboUtils.SPRING_APPLICATION_NAME_PROPERTY; + /** * The lowest precedence {@link EnvironmentPostProcessor} processes * {@link SpringApplication#setDefaultProperties(Properties) Spring Boot default properties} for Dubbo @@ -46,32 +47,13 @@ public class DubboDefaultPropertiesEnvironmentPostProcessor implements Environme /** * 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"; + public static final String PROPERTY_SOURCE_NAME = "defaultProperties"; /** - * The property name of {@link EnableDubboConfig#multiple() @EnableDubboConfig.multiple()} + * The property name of "spring.main.allow-bean-definition-overriding". + * Please refer to: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.1-Release-Notes#bean-overriding */ - private static final String DUBBO_CONFIG_MULTIPLE_PROPERTY = "dubbo.config.multiple"; - - /** - * The property name of {@link ApplicationConfig#getQosEnable() application's QOS enable} - */ - private static final String DUBBO_APPLICATION_QOS_ENABLE_PROPERTY = "dubbo.application.qos-enable"; + public static final String ALLOW_BEAN_DEFINITION_OVERRIDING_PROPERTY = "spring.main.allow-bean-definition-overriding"; @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { @@ -92,6 +74,7 @@ private Map createDefaultProperties(ConfigurableEnvironment envi setDubboApplicationNameProperty(environment, defaultProperties); setDubboConfigMultipleProperty(defaultProperties); setDubboApplicationQosEnableProperty(defaultProperties); + setAllowBeanDefinitionOverriding(defaultProperties); return defaultProperties; } @@ -111,6 +94,18 @@ private void setDubboApplicationQosEnableProperty(Map defaultPro defaultProperties.put(DUBBO_APPLICATION_QOS_ENABLE_PROPERTY, Boolean.FALSE.toString()); } + /** + * Set {@link #ALLOW_BEAN_DEFINITION_OVERRIDING_PROPERTY "spring.main.allow-bean-definition-overriding"} to be + * true as default. + * + * @param defaultProperties the default {@link Properties properties} + * @see #ALLOW_BEAN_DEFINITION_OVERRIDING_PROPERTY + * @since 2.7.1 + */ + private void setAllowBeanDefinitionOverriding(Map defaultProperties) { + defaultProperties.put(ALLOW_BEAN_DEFINITION_OVERRIDING_PROPERTY, Boolean.TRUE.toString()); + } + /** * Copy from BusEnvironmentPostProcessor#addOrReplace(MutablePropertySources, Map) * diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/DubboUtils.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/DubboUtils.java index 5b9fcd491..98b0bcdec 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/DubboUtils.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/DubboUtils.java @@ -16,8 +16,13 @@ */ package org.apache.dubbo.spring.boot.util; +import org.apache.dubbo.config.ApplicationConfig; import org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor; +import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig; +import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfigBinding; import org.apache.dubbo.config.spring.context.properties.DubboConfigBinder; + +import org.springframework.boot.context.ContextIdApplicationContextInitializer; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.PropertyResolver; @@ -126,6 +131,47 @@ public abstract class DubboUtils { */ public static final String BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME = "dubboScanBasePackagesPropertyResolver"; + /** + * The property name of Spring Application + * + * @see ContextIdApplicationContextInitializer + * @since 2.7.1 + */ + public static final String SPRING_APPLICATION_NAME_PROPERTY = "spring.application.name"; + + /** + * The property id of {@link ApplicationConfig} Bean + * + * @see EnableDubboConfig + * @see EnableDubboConfigBinding + * @since 2.7.1 + */ + public static final String DUBBO_APPLICATION_ID_PROPERTY = "dubbo.application.id"; + + /** + * The property name of {@link ApplicationConfig} + * + * @see EnableDubboConfig + * @see EnableDubboConfigBinding + * @since 2.7.1 + */ + public static final String DUBBO_APPLICATION_NAME_PROPERTY = "dubbo.application.name"; + + /** + * The property name of {@link ApplicationConfig#getQosEnable() application's QOS enable} + * + * @since 2.7.1 + */ + public static final String DUBBO_APPLICATION_QOS_ENABLE_PROPERTY = "dubbo.application.qos-enable"; + + /** + * The property name of {@link EnableDubboConfig#multiple() @EnableDubboConfig.multiple()} + * + * @since 2.7.1 + */ + public static final String DUBBO_CONFIG_MULTIPLE_PROPERTY = "dubbo.config.multiple"; + + /** * Filters Dubbo Properties from {@link ConfigurableEnvironment} * diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json b/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json deleted file mode 100644 index d8101217c..000000000 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json +++ /dev/null @@ -1,1098 +0,0 @@ -{ - "hints": [], - "groups": [], - "properties": [ - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.architecture", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.compiler", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.default", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.dump-directory", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.environment", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.logger", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.monitor", - "type": "org.apache.dubbo.config.MonitorConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.name", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.organization", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.owner", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.parameters", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.qos-accept-foreign-ip", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.qos-enable", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.qos-port", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.registries", - "type": "java.util.List" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.registry", - "type": "org.apache.dubbo.config.RegistryConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ApplicationConfig", - "name": "dubbo.application.version", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.applications", - "description": "Multiple {@link ApplicationConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.DubboConfigProperties", - "name": "dubbo.config.multiple", - "description": "Indicates multiple properties binding from externalized configuration or not.", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.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": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.actives", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.application", - "type": "org.apache.dubbo.config.ApplicationConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.async", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.cache", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.callbacks", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.check", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.client", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.cluster", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.connections", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.default", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.filter", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.generic", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.group", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.init", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "deprecated": true, - "name": "dubbo.consumer.injvm", - "type": "java.lang.Boolean", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.layer", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.lazy", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.listener", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.loadbalance", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "deprecated": true, - "name": "dubbo.consumer.local", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.merger", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.mock", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.module", - "type": "org.apache.dubbo.config.ModuleConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.monitor", - "type": "org.apache.dubbo.config.MonitorConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.onconnect", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.ondisconnect", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.owner", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.parameters", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.proxy", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.reconnect", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.registries", - "type": "java.util.List" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.registry", - "type": "org.apache.dubbo.config.RegistryConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.retries", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.scope", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.sent", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.sticky", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.stub", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.timeout", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.validation", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ConsumerConfig", - "name": "dubbo.consumer.version", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.consumers", - "description": "Multiple {@link ConsumerConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.default", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.monitor", - "type": "org.apache.dubbo.config.MonitorConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.name", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.organization", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.owner", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.registries", - "type": "java.util.List" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.registry", - "type": "org.apache.dubbo.config.RegistryConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ModuleConfig", - "name": "dubbo.module.version", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.modules", - "description": "Multiple {@link ModuleConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.address", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.default", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.group", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.parameters", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.password", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.protocol", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.username", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.MonitorConfig", - "name": "dubbo.monitor.version", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.monitors", - "description": "Multiple {@link MonitorConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.accepts", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.accesslog", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.buffer", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.charset", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.client", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.codec", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.contextpath", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.default", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.dispatcher", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "deprecated": true, - "name": "dubbo.protocol.dispather", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.exchanger", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.heartbeat", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.host", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.iothreads", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.name", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.networker", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.parameters", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "deprecated": true, - "name": "dubbo.protocol.path", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.payload", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.port", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.prompt", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.queues", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.register", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.serialization", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.server", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.status", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.telnet", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.threadpool", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.threads", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProtocolConfig", - "name": "dubbo.protocol.transporter", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.protocols", - "description": "Multiple {@link ProtocolConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.accepts", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.accesslog", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.actives", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.application", - "type": "org.apache.dubbo.config.ApplicationConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.async", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.buffer", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.cache", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.callbacks", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.charset", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.client", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.cluster", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.codec", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.connections", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.contextpath", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "deprecated": true, - "name": "dubbo.provider.default", - "type": "java.lang.Boolean", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.delay", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.deprecated", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.dispatcher", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "deprecated": true, - "name": "dubbo.provider.dispather", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.document", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.dynamic", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.exchanger", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.executes", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.export", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.filter", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.group", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.host", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.iothreads", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.layer", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.listener", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.loadbalance", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "deprecated": true, - "name": "dubbo.provider.local", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.merger", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.mock", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.module", - "type": "org.apache.dubbo.config.ModuleConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.monitor", - "type": "org.apache.dubbo.config.MonitorConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.networker", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.onconnect", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.ondisconnect", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.owner", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.parameters", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "deprecated": true, - "name": "dubbo.provider.path", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.payload", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "deprecated": true, - "name": "dubbo.provider.port", - "type": "java.lang.Integer", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.prompt", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.protocol", - "type": "org.apache.dubbo.config.ProtocolConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.protocols", - "type": "java.util.List" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.proxy", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.queues", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.register", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.registries", - "type": "java.util.List" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.registry", - "type": "org.apache.dubbo.config.RegistryConfig" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.retries", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.scope", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.sent", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.serialization", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.server", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.status", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.stub", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.telnet", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.threadpool", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.threads", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.timeout", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.token", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.transporter", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.validation", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.version", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.wait", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.warmup", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.ProviderConfig", - "name": "dubbo.provider.weight", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.providers", - "description": "Multiple {@link ProviderConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties", - "name": "dubbo.registries", - "description": "Multiple {@link RegistryConfig} property", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.address", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.check", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.client", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.cluster", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.default", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.dynamic", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.file", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.group", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.id", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.parameters", - "type": "java.util.Map" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.password", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.port", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.protocol", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.register", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.server", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.session", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.subscribe", - "type": "java.lang.Boolean" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.timeout", - "type": "java.lang.Integer" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "deprecated": true, - "name": "dubbo.registry.transport", - "type": "java.lang.String", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.transporter", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.username", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "name": "dubbo.registry.version", - "type": "java.lang.String" - }, - { - "sourceType": "org.apache.dubbo.config.RegistryConfig", - "deprecated": true, - "name": "dubbo.registry.wait", - "type": "java.lang.Integer", - "deprecation": {} - }, - { - "sourceType": "org.apache.dubbo.spring.boot.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 diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories b/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories index 08db894ac..e3005dba2 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories +++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories @@ -6,4 +6,6 @@ org.apache.dubbo.spring.boot.context.event.OverrideDubboConfigApplicationListene org.apache.dubbo.spring.boot.context.event.WelcomeLogoApplicationListener,\ org.apache.dubbo.spring.boot.context.event.AwaitingNonWebApplicationListener org.springframework.boot.env.EnvironmentPostProcessor=\ -org.apache.dubbo.spring.boot.env.DubboDefaultPropertiesEnvironmentPostProcessor \ No newline at end of file +org.apache.dubbo.spring.boot.env.DubboDefaultPropertiesEnvironmentPostProcessor +org.springframework.context.ApplicationContextInitializer=\ +org.apache.dubbo.spring.boot.context.DubboApplicationContextInitializer \ No newline at end of file diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java index 1addb5e78..ba4e0a40d 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java @@ -23,6 +23,7 @@ import org.apache.dubbo.config.ProtocolConfig; import org.apache.dubbo.config.ProviderConfig; import org.apache.dubbo.config.RegistryConfig; + import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -49,7 +50,6 @@ @TestPropertySource( properties = { "dubbo.applications.application1.NAME = dubbo-demo-application", - "dubbo.applications.application2.name = dubbo-demo-application2", "dubbo.modules.module1.name = dubbo-demo-module", "dubbo.registries.registry1.address = zookeeper://192.168.99.100:32770", "dubbo.protocols.protocol1.name=dubbo", @@ -155,7 +155,7 @@ public class DubboAutoConfigurationOnMultipleConfigTest { public void testMultipleDubboConfigBindingProperties() { - Assert.assertEquals(3, applications.size()); + Assert.assertEquals(1, applications.size()); Assert.assertEquals(1, modules.size()); @@ -179,7 +179,7 @@ public void testApplicationContext() { */ Map applications = beansOfTypeIncludingAncestors(applicationContext, ApplicationConfig.class); - Assert.assertEquals(3, applications.size()); + Assert.assertEquals(1, applications.size()); /** * Multiple {@link ModuleConfig} diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessorTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessorTest.java new file mode 100644 index 000000000..a24ca146a --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/beans/factory/config/DubboConfigBeanDefinitionConflictProcessorTest.java @@ -0,0 +1,109 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.beans.factory.config; + +import org.apache.dubbo.config.ApplicationConfig; +import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.ImportResource; +import org.springframework.context.annotation.PropertySource; +import org.springframework.core.Ordered; + +import java.util.Map; + + +/** + * {@link DubboConfigBeanDefinitionConflictProcessor} Test + * + * @since 2.7.1 + */ +public class DubboConfigBeanDefinitionConflictProcessorTest { + + private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); + + @Before + public void init() { + context.addBeanFactoryPostProcessor(new DubboConfigBeanDefinitionConflictProcessor()); + } + + @After + public void destroy() { + context.close(); + } + + @Test + public void testOrder() { + Assert.assertEquals(Ordered.LOWEST_PRECEDENCE, new DubboConfigBeanDefinitionConflictProcessor().getOrder()); + } + + @Test + public void testNormalCase() { + + System.setProperty("dubbo.application.name", "test-dubbo-application"); + + context.register(DubboConfig.class); + + context.refresh(); + + ApplicationConfig applicationConfig = context.getBean(ApplicationConfig.class); + + Assert.assertEquals("test-dubbo-application", applicationConfig.getName()); + } + + @Test + public void testDuplicatedConfigsCase() { + + context.register(PropertySourceConfig.class, DubboConfig.class); + + context.register(XmlConfig.class); + + context.refresh(); + + Map beansMap = context.getBeansOfType(ApplicationConfig.class); + + ApplicationConfig applicationConfig = beansMap.get("dubbo-consumer-2.7.x"); + + Assert.assertEquals(1, beansMap.size()); + + Assert.assertEquals("dubbo-consumer-2.7.x", applicationConfig.getName()); + } + + @Test(expected = IllegalStateException.class) + public void testFailedCase() { + context.register(ApplicationConfig.class); + testDuplicatedConfigsCase(); + } + + @EnableDubboConfig + static class DubboConfig { + + } + + @PropertySource("classpath:/META-INF/dubbo.properties") + static class PropertySourceConfig { + + } + + @ImportResource("classpath:/META-INF/spring/dubbo-context.xml") + static class XmlConfig { + } +} diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/DubboUtilsTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/DubboUtilsTest.java index 7242b58af..823ddb7db 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/DubboUtilsTest.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/DubboUtilsTest.java @@ -25,6 +25,10 @@ import static org.apache.dubbo.spring.boot.util.DubboUtils.BASE_PACKAGES_PROPERTY_NAME; import static org.apache.dubbo.spring.boot.util.DubboUtils.DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE; import static org.apache.dubbo.spring.boot.util.DubboUtils.DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_APPLICATION_ID_PROPERTY; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_APPLICATION_NAME_PROPERTY; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_APPLICATION_QOS_ENABLE_PROPERTY; +import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_CONFIG_MULTIPLE_PROPERTY; import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_CONFIG_PREFIX; import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_GITHUB_URL; import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_MAILING_LIST; @@ -35,6 +39,7 @@ import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_SPRING_BOOT_ISSUES_URL; import static org.apache.dubbo.spring.boot.util.DubboUtils.MULTIPLE_CONFIG_PROPERTY_NAME; import static org.apache.dubbo.spring.boot.util.DubboUtils.OVERRIDE_CONFIG_FULL_PROPERTY_NAME; +import static org.apache.dubbo.spring.boot.util.DubboUtils.SPRING_APPLICATION_NAME_PROPERTY; import static org.apache.dubbo.spring.boot.util.DubboUtils.filterDubboProperties; /** @@ -68,10 +73,17 @@ public void testConstants() { Assert.assertEquals("dev@dubbo.apache.org", DUBBO_MAILING_LIST); + Assert.assertEquals("spring.application.name", SPRING_APPLICATION_NAME_PROPERTY); + Assert.assertEquals("dubbo.application.id", DUBBO_APPLICATION_ID_PROPERTY); + Assert.assertEquals("dubbo.application.name", DUBBO_APPLICATION_NAME_PROPERTY); + Assert.assertEquals("dubbo.application.qos-enable", DUBBO_APPLICATION_QOS_ENABLE_PROPERTY); + Assert.assertEquals("dubbo.config.multiple", DUBBO_CONFIG_MULTIPLE_PROPERTY); + Assert.assertTrue(DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE); Assert.assertTrue(DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE); + } diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/dubbo.properties b/dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/dubbo.properties new file mode 100644 index 000000000..97633c54d --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/dubbo.properties @@ -0,0 +1 @@ +dubbo.application.id = test-dubbo-application-id \ No newline at end of file diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/spring/dubbo-context.xml b/dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/spring/dubbo-context.xml new file mode 100644 index 000000000..87b6505cf --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/resources/META-INF/spring/dubbo-context.xml @@ -0,0 +1,14 @@ + + + + + + + + \ No newline at end of file diff --git a/dubbo-spring-boot-parent/pom.xml b/dubbo-spring-boot-parent/pom.xml index 9d7b1e8a9..085092010 100644 --- a/dubbo-spring-boot-parent/pom.xml +++ b/dubbo-spring-boot-parent/pom.xml @@ -38,11 +38,10 @@ 1.8 UTF-8 UTF-8 - 2.1.2.RELEASE - 2.7.0 + 2.1.3.RELEASE + ${revision} - -server -Xms256m -Xmx512m -XX:PermSize=64m -XX:MaxPermSize=128m -Dfile.encoding=UTF-8 - -Djava.net.preferIPv4Stack=true + -server -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true @@ -227,11 +226,10 @@ maven-compiler-plugin ${maven-compiler-plugin.version} - -proc:none true ${java.source.version} ${java.target.version} - ${file.encoding} + ${project.build.sourceEncoding} diff --git a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java index 5b2ac82eb..be83edf9e 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java +++ b/dubbo-spring-boot-samples/auto-configure-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboAutoConfigurationConsumerBootstrap.java @@ -44,8 +44,6 @@ public static void main(String[] args) { @Bean public ApplicationRunner runner() { - return args -> { - logger.info(demoService.sayHello("mercyblitz")); - }; + return args -> logger.info(demoService.sayHello("mercyblitz")); } } diff --git a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java index 61195ac6d..325b19abf 100644 --- a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java @@ -35,6 +35,7 @@ public class DefaultDemoService implements DemoService { @Value("${dubbo.application.name}") private String serviceName; + @Override public String sayHello(String name) { return String.format("[%s] : Hello, %s", serviceName, name); } diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml index 1941193ea..edaf3049c 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml @@ -53,19 +53,12 @@ ${revision} + - org.apache.curator - curator-framework - - - - org.apache.curator - curator-recipes - - - - org.apache.zookeeper - zookeeper + org.apache.dubbo + dubbo-dependencies-zookeeper + ${dubbo.version} + pom diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java index 3da78b1a1..81829ca3d 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboRegistryZooKeeperConsumerBootstrap.java @@ -18,7 +18,6 @@ import org.apache.dubbo.config.annotation.Reference; import org.apache.dubbo.spring.boot.demo.consumer.DemoService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.ApplicationRunner; @@ -43,8 +42,6 @@ public static void main(String[] args) { @Bean public ApplicationRunner runner() { - return args -> { - logger.info(demoService.sayHello("mercyblitz")); - }; + return args -> logger.info(demoService.sayHello("mercyblitz")); } } diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/resources/application.yml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/resources/application.yml index 88846fbed..a533b4d60 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/resources/application.yml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/src/main/resources/application.yml @@ -12,4 +12,5 @@ embedded: dubbo: registry: - address: zookeeper://127.0.0.1:${embedded.zookeeper.port} \ No newline at end of file + address: zookeeper://127.0.0.1:${embedded.zookeeper.port} + file: ${user.home}/dubbo-cache/${spring.application.name}/dubbo.cache \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml index c41c446a5..8f1719afb 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml @@ -55,20 +55,12 @@ ${revision} - + - org.apache.zookeeper - zookeeper - - - - org.apache.curator - curator-framework - - - - org.apache.curator - curator-recipes + org.apache.dubbo + dubbo-dependencies-zookeeper + ${dubbo.version} + pom diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/EmbeddedZooKeeper.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/EmbeddedZooKeeper.java index 1758fc858..56ecea477 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/EmbeddedZooKeeper.java +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/EmbeddedZooKeeper.java @@ -93,6 +93,7 @@ public EmbeddedZooKeeper() { * Construct an EmbeddedZooKeeper with the provided port. * * @param clientPort port for ZooKeeper server to bind to + * @param daemon is daemon or not thread. */ public EmbeddedZooKeeper(int clientPort, boolean daemon) { this.clientPort = clientPort; diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java index 6ff5f7ab1..bf5f80d99 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java @@ -35,6 +35,7 @@ public class DefaultDemoService implements DemoService { @Value("${dubbo.application.name}") private String serviceName; + @Override public String sayHello(String name) { return String.format("[%s] : Hello, %s", serviceName, name); } diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties index d66c19dea..0c9116cdd 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/resources/application.properties @@ -16,6 +16,7 @@ dubbo.protocol.port=-1 ## Dubbo Registry dubbo.registry.address=zookeeper://127.0.0.1:${embedded.zookeeper.port} +dubbo.registry.file = ${user.home}/dubbo-cache/${spring.application.name}/dubbo.cache ## DemoService version demo.service.version=1.0.0 \ No newline at end of file diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java index f36ec2b6c..39f75b826 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboExternalizedConfigurationConsumerBootstrap.java @@ -51,8 +51,6 @@ public String sayHello(@RequestParam String name) { @Bean public ApplicationRunner runner() { - return args -> { - logger.info(demoService.sayHello("mercyblitz")); - }; + return args -> logger.info(demoService.sayHello("mercyblitz")); } } diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java index 6ff5f7ab1..bf5f80d99 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java @@ -35,6 +35,7 @@ public class DefaultDemoService implements DemoService { @Value("${dubbo.application.name}") private String serviceName; + @Override public String sayHello(String name) { return String.format("[%s] : Hello, %s", serviceName, name); } diff --git a/pom.xml b/pom.xml index ffefee6a9..e8d9e32f9 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ 3.0.1 2.19.1 - 2.7.0 + 2.7.1-SNAPSHOT @@ -114,6 +114,7 @@ + org.apache.maven.plugins maven-gpg-plugin @@ -126,6 +127,7 @@ + org.codehaus.mojo flatten-maven-plugin @@ -151,9 +153,40 @@ + + + + + org.codehaus.mojo + flatten-maven-plugin + 1.1.0 + + true + resolveCiFriendliesOnly + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + + + + \ No newline at end of file From 006cadc7fd3dac1dded35a525d685b0788191874 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Wed, 27 Mar 2019 10:37:15 +0800 Subject: [PATCH 43/46] Update 2.7.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e8d9e32f9..95f09ae57 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ 3.0.1 2.19.1 - 2.7.1-SNAPSHOT + 2.7.1 From af590e9ff91c8ca586a9d26e59da9033a2c23663 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Thu, 28 Mar 2019 10:33:49 +0800 Subject: [PATCH 44/46] Remove uesless files in source code distribution. --- dubbo-spring-boot-distribution/assembly/source-release.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dubbo-spring-boot-distribution/assembly/source-release.xml b/dubbo-spring-boot-distribution/assembly/source-release.xml index bbbec6151..e6e3e9202 100644 --- a/dubbo-spring-boot-distribution/assembly/source-release.xml +++ b/dubbo-spring-boot-distribution/assembly/source-release.xml @@ -49,6 +49,8 @@ **/.mvn/** **/*.jar **/mvnw* + **/.flattened-pom.xml + **/.travis.yml From a4f21f076ccb162a5ea1f1486d6382bbba18efef Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Thu, 11 Apr 2019 17:33:10 +0800 Subject: [PATCH 45/46] Polish apache/incubator-dubbo-spring-boot-project#488 --- .../consumer-sample/pom.xml | 58 +++++++++++++++ .../DubboRegistryNacosConsumerBootstrap.java | 48 ++++++++++++ .../src/main/resources/application.yml | 15 ++++ .../dubbo-registry-nacos-samples/pom.xml | 41 ++++++++++ .../provider-sample/pom.xml | 74 +++++++++++++++++++ .../DubboRegistryNacosProviderBootstrap.java | 37 ++++++++++ .../provider/service/DefaultDemoService.java | 43 +++++++++++ .../src/main/resources/application.properties | 21 ++++++ dubbo-spring-boot-samples/pom.xml | 3 +- 9 files changed, 339 insertions(+), 1 deletion(-) create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/resources/application.yml create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboRegistryNacosProviderBootstrap.java create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java create mode 100644 dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/resources/application.properties diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml new file mode 100644 index 000000000..f0ece9810 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml @@ -0,0 +1,58 @@ + + + + dubbo-spring-boot-registry-nacos-samples + org.apache.dubbo.samples + 2.7.1 + + 4.0.0 + + dubbo-spring-boot-registry-nacos-consumer-sample + Apache Dubbo Spring Boot :: Samples : Registry Nacos :: Consumer Sample + + + 1.0.0-RC3 + + + + + + org.springframework.boot + spring-boot-starter + + + + org.apache.dubbo + dubbo-spring-boot-starter + ${revision} + + + + + org.apache.dubbo + dubbo + + + + + org.apache.dubbo + dubbo-registry-nacos + ${revision} + + + + com.alibaba.nacos + nacos-client + ${nacos.version} + + + + org.apache.dubbo.samples + dubbo-spring-boot-sample-api + ${revision} + + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java new file mode 100644 index 000000000..f42a4eb05 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/bootstrap/DubboRegistryNacosConsumerBootstrap.java @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.demo.consumer.bootstrap; + +import org.apache.dubbo.config.annotation.Reference; +import org.apache.dubbo.spring.boot.demo.consumer.DemoService; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.ApplicationRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Bean; + +/** + * Dubbo Registry ZooKeeper Nacos Bootstrap + */ +@EnableAutoConfiguration +public class DubboRegistryNacosConsumerBootstrap { + + private final Logger logger = LoggerFactory.getLogger(getClass()); + + @Reference(version = "${demo.service.version}") + private DemoService demoService; + + public static void main(String[] args) { + SpringApplication.run(DubboRegistryNacosConsumerBootstrap.class).close(); + } + + @Bean + public ApplicationRunner runner() { + return args -> logger.info(demoService.sayHello("mercyblitz")); + } +} diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/resources/application.yml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/resources/application.yml new file mode 100644 index 000000000..ebfd149fb --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/src/main/resources/application.yml @@ -0,0 +1,15 @@ +spring: + application: + name: dubbo-registry-nacos-consumer-sample + +demo: + service: + version: 1.0.0 + +nacos: + host: 127.0.0.1 + port: 8848 + +dubbo: + registry: + address: nacos://${nacos.host}:${nacos.port} \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml new file mode 100644 index 000000000..56badba68 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml @@ -0,0 +1,41 @@ + + + + + dubbo-spring-boot-samples + org.apache.dubbo.samples + ${revision} + ../pom.xml + + + 4.0.0 + + dubbo-spring-boot-registry-nacos-samples + Apache Dubbo Spring Boot :: Samples : Registry Nacos + Apache Dubbo Spring Boot Registry Nacos Samples + pom + + + + provider-sample + consumer-sample + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml new file mode 100644 index 000000000..6996621c6 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/pom.xml @@ -0,0 +1,74 @@ + + + + + org.apache.dubbo.samples + dubbo-spring-boot-registry-nacos-samples + ${revision} + ../pom.xml + + 4.0.0 + + dubbo-spring-boot-registry-nacos-provider-sample + Apache Dubbo Spring Boot :: Samples : Registry Nacos :: Provider Sample + + + 1.0.0-RC3 + + + + + + org.springframework.boot + spring-boot-starter + + + + org.apache.dubbo + dubbo-spring-boot-starter + ${revision} + + + + + org.apache.dubbo + dubbo + + + + + org.apache.dubbo + dubbo-registry-nacos + ${revision} + + + + com.alibaba.nacos + nacos-client + ${nacos.version} + + + + org.apache.dubbo.samples + dubbo-spring-boot-sample-api + ${revision} + + + \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboRegistryNacosProviderBootstrap.java b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboRegistryNacosProviderBootstrap.java new file mode 100644 index 000000000..64b523f4b --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboRegistryNacosProviderBootstrap.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.demo.provider.bootstrap; + +import org.apache.dubbo.spring.boot.demo.provider.service.DefaultDemoService; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.builder.SpringApplicationBuilder; + +/** + * Dubbo Registry Nacos Provider Bootstrap + * + * @see DefaultDemoService + * @since 2.7.0 + */ +@EnableAutoConfiguration +public class DubboRegistryNacosProviderBootstrap { + + public static void main(String[] args) { + new SpringApplicationBuilder(DubboRegistryNacosProviderBootstrap.class) + .run(args); + } +} diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java new file mode 100644 index 000000000..bbfe5254c --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/service/DefaultDemoService.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.spring.boot.demo.provider.service; + +import org.apache.dubbo.config.annotation.Service; +import org.apache.dubbo.spring.boot.demo.consumer.DemoService; + +import org.springframework.beans.factory.annotation.Value; + +/** + * Default {@link DemoService} + * + * @see DemoService + * @since 2.7.0 + */ +@Service(version = "${demo.service.version}") +public class DefaultDemoService implements DemoService { + + /** + * The default value of ${dubbo.application.name} is ${spring.application.name} + */ + @Value("${dubbo.application.name}") + private String serviceName; + + @Override + public String sayHello(String name) { + return String.format("[%s] : Hello, %s", serviceName, name); + } +} \ No newline at end of file diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/resources/application.properties b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/resources/application.properties new file mode 100644 index 000000000..38c2eb445 --- /dev/null +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/provider-sample/src/main/resources/application.properties @@ -0,0 +1,21 @@ +# Spring boot application +spring.application.name=dubbo-registry-nacos-provider-sample +# Base packages to scan Dubbo Component: @org.apache.dubbo.config.annotation.Service +dubbo.scan.base-packages=org.apache.dubbo.spring.boot.demo.provider.service + +# Dubbo Application +## The default value of dubbo.application.name is ${spring.application.name} +## dubbo.application.name=${spring.application.name} +nacos.server-address = 127.0.0.1 +nacos.port = 8848 + +# Dubbo Protocol +dubbo.protocol.name=dubbo +## Random port +dubbo.protocol.port=-1 + +## Dubbo Registry +dubbo.registry.address=nacos://${nacos.server-address}:${nacos.port} + +## DemoService version +demo.service.version=1.0.0 \ No newline at end of file diff --git a/dubbo-spring-boot-samples/pom.xml b/dubbo-spring-boot-samples/pom.xml index 450f328e5..579f3feda 100644 --- a/dubbo-spring-boot-samples/pom.xml +++ b/dubbo-spring-boot-samples/pom.xml @@ -14,7 +14,7 @@ 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. - --> +--> @@ -37,6 +37,7 @@ auto-configure-samples externalized-configuration-samples dubbo-registry-zookeeper-samples + dubbo-registry-nacos-samples From 2c7b89075b5c266c6c66f2dca8972e173ded5ad0 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Thu, 11 Apr 2019 17:37:16 +0800 Subject: [PATCH 46/46] Update ASF License --- .../consumer-sample/pom.xml | 16 ++++++++++++++++ .../consumer-sample/pom.xml | 2 +- .../provider-sample/pom.xml | 2 +- .../consumer-sample/pom.xml | 2 +- .../externalized-configuration-samples/pom.xml | 2 +- .../provider-sample/pom.xml | 2 +- dubbo-spring-boot-samples/sample-api/pom.xml | 2 +- 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml index f0ece9810..fd0cc790e 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-nacos-samples/consumer-sample/pom.xml @@ -1,4 +1,20 @@ + diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml index edaf3049c..42860c153 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/consumer-sample/pom.xml @@ -14,7 +14,7 @@ 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. - --> +--> diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml index 8f1719afb..94e7598c6 100644 --- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/pom.xml @@ -14,7 +14,7 @@ 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. - --> +--> diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml index 893dd4b2f..edafe3d6e 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/consumer-sample/pom.xml @@ -14,7 +14,7 @@ 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. - --> +--> diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml index 86e26ad86..db6f08a46 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml @@ -14,7 +14,7 @@ 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. - --> +--> diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml index 47a2bb1b6..74ee45cd1 100644 --- a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml +++ b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/pom.xml @@ -14,7 +14,7 @@ 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. - --> +--> diff --git a/dubbo-spring-boot-samples/sample-api/pom.xml b/dubbo-spring-boot-samples/sample-api/pom.xml index 25964a542..3f3b32b13 100644 --- a/dubbo-spring-boot-samples/sample-api/pom.xml +++ b/dubbo-spring-boot-samples/sample-api/pom.xml @@ -14,7 +14,7 @@ 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. - --> +-->