1.0.0 (#429) (#430)
* 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 <projectId>
* 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
diff --git a/NOTICE b/NOTICE
index 97fefd0..62b2787 100644
--- a/NOTICE
+++ b/NOTICE
@@ -2,13 +2,4 @@
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
+The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
diff --git a/dubbo-spring-boot-actuator/pom.xml b/dubbo-spring-boot-actuator/pom.xml
index 592bcd6..ef7eed3 100644
--- a/dubbo-spring-boot-actuator/pom.xml
+++ b/dubbo-spring-boot-actuator/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -27,12 +28,19 @@
<artifactId>dubbo-spring-boot-actuator</artifactId>
<packaging>jar</packaging>
- <name>Apache Dubbo Spring Boot Actuator</name>
+ <name>Apache Dubbo Spring Boot :: Actuator</name>
<description>Apache Dubbo Spring Boot Actuator</description>
<dependencies>
<dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-actuator-compatible</artifactId>
+ <version>${revision}</version>
+ </dependency>
+
+ <!-- Spring Boot -->
+ <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<optional>true</optional>
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointsAutoConfiguration.java b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfiguration.java
similarity index 85%
rename from dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointsAutoConfiguration.java
rename to dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfiguration.java
index fd5a7aa..aa65366 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointsAutoConfiguration.java
+++ b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfiguration.java
@@ -17,12 +17,11 @@
package org.apache.dubbo.spring.boot.actuate.autoconfigure;
import org.apache.dubbo.spring.boot.actuate.endpoint.DubboConfigsMetadataEndpoint;
-import org.apache.dubbo.spring.boot.actuate.endpoint.DubboEndpoint;
-import org.apache.dubbo.spring.boot.actuate.endpoint.DubboPropertiesEndpoint;
+import org.apache.dubbo.spring.boot.actuate.endpoint.DubboMetadataEndpoint;
+import org.apache.dubbo.spring.boot.actuate.endpoint.DubboPropertiesMetadataEndpoint;
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 org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnEnabledEndpoint;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
@@ -31,23 +30,23 @@
import org.springframework.context.annotation.PropertySource;
/**
- * Dubbo {@link Endpoint} Auto-{@link Configuration}
+ * Dubbo {@link Endpoint @Endpoint} Auto-{@link Configuration} for Spring Boot Actuator 2.0
*
* @see Endpoint
* @see Configuration
- * @since 0.2.0
+ * @since 2.7.0
*/
@Configuration
@PropertySource(
name = "Dubbo Endpoints Default Properties",
value = "classpath:/META-INF/dubbo-endpoins-default.properties")
-public class DubboEndpointsAutoConfiguration {
+public class DubboEndpointAnnotationAutoConfiguration {
@Bean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
- public DubboEndpoint dubboEndpoint() {
- return new DubboEndpoint();
+ public DubboMetadataEndpoint dubboEndpoint() {
+ return new DubboMetadataEndpoint();
}
@Bean
@@ -60,8 +59,8 @@
@Bean
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint
- public DubboPropertiesEndpoint dubboPropertiesEndpoint() {
- return new DubboPropertiesEndpoint();
+ public DubboPropertiesMetadataEndpoint dubboPropertiesEndpoint() {
+ return new DubboPropertiesMetadataEndpoint();
}
@Bean
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboConfigsMetadataEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboConfigsMetadataEndpoint.java
index 2cce543..0f57fa7 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboConfigsMetadataEndpoint.java
+++ b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboConfigsMetadataEndpoint.java
@@ -16,74 +16,27 @@
*/
package org.apache.dubbo.spring.boot.actuate.endpoint;
-import org.apache.dubbo.config.AbstractConfig;
-import org.apache.dubbo.config.ApplicationConfig;
-import org.apache.dubbo.config.ConsumerConfig;
-import org.apache.dubbo.config.MethodConfig;
-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.ReferenceConfig;
-import org.apache.dubbo.config.RegistryConfig;
-import org.apache.dubbo.config.ServiceConfig;
-
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.AbstractDubboMetadata;
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboConfigsMetadata;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
-import java.util.LinkedHashMap;
import java.util.Map;
-import java.util.TreeMap;
-
-import static org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors;
/**
* Dubbo Configs Metadata {@link Endpoint}
*
- * @since 0.2.0
+ * @since 2.7.0
*/
@Endpoint(id = "dubboconfigs")
-public class DubboConfigsMetadataEndpoint extends AbstractDubboEndpoint {
+public class DubboConfigsMetadataEndpoint extends AbstractDubboMetadata {
+
+ @Autowired
+ private DubboConfigsMetadata dubboConfigsMetadata;
@ReadOperation
public Map<String, Map<String, Map<String, Object>>> configs() {
-
- Map<String, Map<String, Map<String, Object>>> configsMap = new LinkedHashMap<>();
-
- addDubboConfigBeans(ApplicationConfig.class, configsMap);
- addDubboConfigBeans(ConsumerConfig.class, configsMap);
- addDubboConfigBeans(MethodConfig.class, configsMap);
- addDubboConfigBeans(ModuleConfig.class, configsMap);
- addDubboConfigBeans(MonitorConfig.class, configsMap);
- addDubboConfigBeans(ProtocolConfig.class, configsMap);
- addDubboConfigBeans(ProviderConfig.class, configsMap);
- addDubboConfigBeans(ReferenceConfig.class, configsMap);
- addDubboConfigBeans(RegistryConfig.class, configsMap);
- addDubboConfigBeans(ServiceConfig.class, configsMap);
-
- return configsMap;
-
- }
-
- private void addDubboConfigBeans(Class<? extends AbstractConfig> dubboConfigClass,
- Map<String, Map<String, Map<String, Object>>> configsMap) {
-
- Map<String, ? extends AbstractConfig> dubboConfigBeans = beansOfTypeIncludingAncestors(applicationContext, dubboConfigClass);
-
- String name = dubboConfigClass.getSimpleName();
-
- Map<String, Map<String, Object>> beansMetadata = new TreeMap<>();
-
- for (Map.Entry<String, ? extends AbstractConfig> entry : dubboConfigBeans.entrySet()) {
-
- String beanName = entry.getKey();
- AbstractConfig configBean = entry.getValue();
- Map<String, Object> configBeanMeta = resolveBeanMetadata(configBean);
- beansMetadata.put(beanName, configBeanMeta);
-
- }
-
- configsMap.put(name, beansMetadata);
-
+ return dubboConfigsMetadata.configs();
}
}
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboPropertiesEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboMetadataEndpoint.java
similarity index 70%
copy from dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboPropertiesEndpoint.java
copy to dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboMetadataEndpoint.java
index 65de76d..d7d4e58 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboPropertiesEndpoint.java
+++ b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboMetadataEndpoint.java
@@ -16,26 +16,28 @@
*/
package org.apache.dubbo.spring.boot.actuate.endpoint;
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboMetadata;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
-import java.util.SortedMap;
-
-import static org.apache.dubbo.spring.boot.util.DubboUtils.filterDubboProperties;
+import java.util.Map;
/**
- * Dubbo Properties {@link Endpoint}
+ * Actuator {@link Endpoint} to expose Dubbo Meta Data
*
- * @since 1.0.0
+ * @see Endpoint
+ * @since 2.7.0
*/
-@Endpoint(id = "dubboproperties")
-public class DubboPropertiesEndpoint extends AbstractDubboEndpoint {
+@Endpoint(id = "dubbo")
+public class DubboMetadataEndpoint {
+
+ @Autowired
+ private DubboMetadata dubboMetadata;
@ReadOperation
- public SortedMap<String, Object> properties() {
-
- return filterDubboProperties(environment);
-
+ public Map<String, Object> invoke() {
+ return dubboMetadata.invoke();
}
}
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboPropertiesEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboPropertiesMetadataEndpoint.java
similarity index 72%
copy from dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboPropertiesEndpoint.java
copy to dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboPropertiesMetadataEndpoint.java
index 65de76d..6084d3f 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboPropertiesEndpoint.java
+++ b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboPropertiesMetadataEndpoint.java
@@ -16,26 +16,27 @@
*/
package org.apache.dubbo.spring.boot.actuate.endpoint;
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.AbstractDubboMetadata;
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboPropertiesMetadata;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import java.util.SortedMap;
-import static org.apache.dubbo.spring.boot.util.DubboUtils.filterDubboProperties;
-
/**
* Dubbo Properties {@link Endpoint}
*
- * @since 1.0.0
+ * @since 2.7.0
*/
@Endpoint(id = "dubboproperties")
-public class DubboPropertiesEndpoint extends AbstractDubboEndpoint {
+public class DubboPropertiesMetadataEndpoint extends AbstractDubboMetadata {
+
+ @Autowired
+ private DubboPropertiesMetadata dubboPropertiesMetadata;
@ReadOperation
public SortedMap<String, Object> properties() {
-
- return filterDubboProperties(environment);
-
+ return dubboPropertiesMetadata.properties();
}
-
}
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboReferencesMetadataEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboReferencesMetadataEndpoint.java
index b6aa6ff..54de83c 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboReferencesMetadataEndpoint.java
+++ b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboReferencesMetadataEndpoint.java
@@ -17,57 +17,27 @@
package org.apache.dubbo.spring.boot.actuate.endpoint;
import org.apache.dubbo.config.annotation.Reference;
-import org.apache.dubbo.config.spring.ReferenceBean;
-import org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor;
-
-import org.springframework.beans.factory.annotation.InjectionMetadata;
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.AbstractDubboMetadata;
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboReferencesMetadata;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
-import java.util.LinkedHashMap;
import java.util.Map;
/**
* Dubbo {@link Reference} Metadata {@link Endpoint}
*
- * @since 1.0.0
+ * @since 2.7.0
*/
@Endpoint(id = "dubboreferences")
-public class DubboReferencesMetadataEndpoint extends AbstractDubboEndpoint {
+public class DubboReferencesMetadataEndpoint extends AbstractDubboMetadata {
+
+ @Autowired
+ private DubboReferencesMetadata dubboReferencesMetadata;
@ReadOperation
public Map<String, Map<String, Object>> references() {
-
- Map<String, Map<String, Object>> referencesMetadata = new LinkedHashMap<>();
-
- ReferenceAnnotationBeanPostProcessor beanPostProcessor = getReferenceAnnotationBeanPostProcessor();
-
- referencesMetadata.putAll(buildReferencesMetadata(beanPostProcessor.getInjectedFieldReferenceBeanMap()));
- referencesMetadata.putAll(buildReferencesMetadata(beanPostProcessor.getInjectedMethodReferenceBeanMap()));
-
- return referencesMetadata;
-
+ return dubboReferencesMetadata.references();
}
-
- private Map<String, Map<String, Object>> buildReferencesMetadata(
- Map<InjectionMetadata.InjectedElement, ReferenceBean<?>> injectedElementReferenceBeanMap) {
- Map<String, Map<String, Object>> referencesMetadata = new LinkedHashMap<>();
-
- for (Map.Entry<InjectionMetadata.InjectedElement, ReferenceBean<?>> entry :
- injectedElementReferenceBeanMap.entrySet()) {
-
- InjectionMetadata.InjectedElement injectedElement = entry.getKey();
-
- ReferenceBean<?> referenceBean = entry.getValue();
-
- Map<String, Object> beanMetadata = resolveBeanMetadata(referenceBean);
- beanMetadata.put("invoker", resolveBeanMetadata(referenceBean.get()));
-
- referencesMetadata.put(String.valueOf(injectedElement.getMember()), beanMetadata);
-
- }
-
- return referencesMetadata;
- }
-
}
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboServicesMetadataEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboServicesMetadataEndpoint.java
index dfef5a8..e92f011 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboServicesMetadataEndpoint.java
+++ b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboServicesMetadataEndpoint.java
@@ -17,70 +17,27 @@
package org.apache.dubbo.spring.boot.actuate.endpoint;
import org.apache.dubbo.config.annotation.Service;
-import org.apache.dubbo.config.spring.ServiceBean;
-
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.AbstractDubboMetadata;
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboServicesMetadata;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
-import java.util.LinkedHashMap;
import java.util.Map;
/**
* Dubbo {@link Service} Metadata {@link Endpoint}
*
- * @since 0.2.0
+ * @since 2.7.0
*/
@Endpoint(id = "dubboservices")
-public class DubboServicesMetadataEndpoint extends AbstractDubboEndpoint {
+public class DubboServicesMetadataEndpoint extends AbstractDubboMetadata {
+
+ @Autowired
+ private DubboServicesMetadata dubboServicesMetadata;
@ReadOperation
public Map<String, Map<String, Object>> services() {
-
- Map<String, ServiceBean> serviceBeansMap = getServiceBeansMap();
-
- Map<String, Map<String, Object>> servicesMetadata = new LinkedHashMap<>(serviceBeansMap.size());
-
- for (Map.Entry<String, ServiceBean> entry : serviceBeansMap.entrySet()) {
-
- String serviceBeanName = entry.getKey();
-
- ServiceBean serviceBean = entry.getValue();
-
- Map<String, Object> serviceBeanMetadata = resolveBeanMetadata(serviceBean);
-
- Object service = resolveServiceBean(serviceBeanName, serviceBean);
-
- if (service != null) {
- // Add Service implementation class
- serviceBeanMetadata.put("serviceClass", service.getClass().getName());
- }
-
- servicesMetadata.put(serviceBeanName, serviceBeanMetadata);
-
- }
-
- return servicesMetadata;
-
+ return dubboServicesMetadata.services();
}
-
- private Object resolveServiceBean(String serviceBeanName, ServiceBean serviceBean) {
-
- int index = serviceBeanName.indexOf("#");
-
- if (index > -1) {
-
- Class<?> interfaceClass = serviceBean.getInterfaceClass();
-
- String serviceName = serviceBeanName.substring(index + 1);
-
- if (applicationContext.containsBean(serviceName)) {
- return applicationContext.getBean(serviceName, interfaceClass);
- }
-
- }
-
- return null;
-
- }
-
}
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboShutdownEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboShutdownEndpoint.java
index a10f4d4..b372472 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboShutdownEndpoint.java
+++ b/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboShutdownEndpoint.java
@@ -16,65 +16,28 @@
*/
package org.apache.dubbo.spring.boot.actuate.endpoint;
-import org.apache.dubbo.config.spring.ServiceBean;
-import org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor;
-
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.AbstractDubboMetadata;
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboShutdownMetadata;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
-import java.util.LinkedHashMap;
import java.util.Map;
-import java.util.TreeMap;
-
-import static org.apache.dubbo.registry.support.AbstractRegistryFactory.getRegistries;
/**
* Dubbo Shutdown
*
- * @since 0.2.0
+ * @since 2.7.0
*/
@Endpoint(id = "dubboshutdown")
-public class DubboShutdownEndpoint extends AbstractDubboEndpoint {
+public class DubboShutdownEndpoint extends AbstractDubboMetadata {
+ @Autowired
+ private DubboShutdownMetadata dubboShutdownMetadata;
@WriteOperation
public Map<String, Object> shutdown() throws Exception {
-
- Map<String, Object> shutdownCountData = new LinkedHashMap<>();
-
- // registries
- int registriesCount = getRegistries().size();
-
- // protocols
- int protocolsCount = getProtocolConfigsBeanMap().size();
-
- shutdownCountData.put("registries", registriesCount);
- shutdownCountData.put("protocols", protocolsCount);
-
- // Service Beans
- Map<String, ServiceBean> serviceBeansMap = getServiceBeansMap();
- if (!serviceBeansMap.isEmpty()) {
- for (ServiceBean serviceBean : serviceBeansMap.values()) {
- serviceBean.destroy();
- }
- }
- shutdownCountData.put("services", serviceBeansMap.size());
-
- // Reference Beans
- ReferenceAnnotationBeanPostProcessor beanPostProcessor = getReferenceAnnotationBeanPostProcessor();
-
- int referencesCount = beanPostProcessor.getReferenceBeans().size();
-
- beanPostProcessor.destroy();
-
- shutdownCountData.put("references", referencesCount);
-
- // Set Result to complete
- Map<String, Object> shutdownData = new TreeMap<>();
- shutdownData.put("shutdown.count", shutdownCountData);
-
-
- return shutdownData;
+ return dubboShutdownMetadata.shutdown();
}
}
diff --git a/dubbo-spring-boot-actuator/src/main/resources/META-INF/spring.factories b/dubbo-spring-boot-actuator/src/main/resources/META-INF/spring.factories
index f80694c..53a1bb0 100644
--- a/dubbo-spring-boot-actuator/src/main/resources/META-INF/spring.factories
+++ b/dubbo-spring-boot-actuator/src/main/resources/META-INF/spring.factories
@@ -1,3 +1,2 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointsAutoConfiguration,\
-org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboHealthIndicatorAutoConfiguration
\ No newline at end of file
+org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAnnotationAutoConfiguration
\ No newline at end of file
diff --git a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java b/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java
similarity index 87%
rename from dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java
rename to dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java
index 39d06e7..d9747cc 100644
--- a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java
+++ b/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java
@@ -14,13 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.spring.boot.actuate.endpoint;
-
-import org.apache.dubbo.config.annotation.Service;
-import org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointsAutoConfiguration;
+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;
+import org.apache.dubbo.spring.boot.actuate.endpoint.DubboPropertiesMetadataEndpoint;
+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 org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -36,15 +40,14 @@
import java.util.function.Supplier;
/**
- * {@link DubboEndpointsAutoConfiguration} Test
+ * {@link DubboEndpointAnnotationAutoConfiguration} Test
*
- * @since 0.2.0
+ * @since 2.7.0
*/
@RunWith(SpringRunner.class)
@SpringBootTest(
classes = {
- DubboEndpointsAutoConfiguration.class,
- DubboEndpointsAutoConfigurationTest.class
+ DubboEndpointAnnotationAutoConfigurationTest.class
},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = {
@@ -60,7 +63,7 @@
"dubbo.protocol.port=20880",
"dubbo.provider.id=my-provider",
"dubbo.provider.host=127.0.0.1",
- "dubbo.scan.basePackages= org.apache.dubbo.spring.boot.actuate.endpoint",
+ "dubbo.scan.basePackages = org.apache.dubbo.spring.boot.actuate.autoconfigure",
"management.endpoint.dubbo.enabled = true",
"management.endpoint.dubboshutdown.enabled = true",
"management.endpoint.dubboconfigs.enabled = true",
@@ -70,16 +73,16 @@
"management.endpoints.web.exposure.include = *",
})
@EnableAutoConfiguration
-public class DubboEndpointsAutoConfigurationTest {
+public class DubboEndpointAnnotationAutoConfigurationTest {
@Autowired
- private DubboEndpoint dubboEndpoint;
+ private DubboMetadataEndpoint dubboEndpoint;
@Autowired
private DubboConfigsMetadataEndpoint dubboConfigsMetadataEndpoint;
@Autowired
- private DubboPropertiesEndpoint dubboPropertiesEndpoint;
+ private DubboPropertiesMetadataEndpoint dubboPropertiesEndpoint;
@Autowired
private DubboReferencesMetadataEndpoint dubboReferencesMetadataEndpoint;
@@ -156,7 +159,7 @@
Assert.assertEquals(1, services.size());
- Map<String, Object> demoServiceMeta = services.get("ServiceBean:org.apache.dubbo.spring.boot.actuate.endpoint.DubboEndpointsAutoConfigurationTest$DemoService:1.0.0");
+ Map<String, Object> demoServiceMeta = services.get("ServiceBean:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAnnotationAutoConfigurationTest$DemoService:1.0.0");
Assert.assertEquals("1.0.0", demoServiceMeta.get("version"));
@@ -187,7 +190,7 @@
Assert.assertEquals("20880", properties.get("dubbo.protocol.port"));
Assert.assertEquals("my-provider", properties.get("dubbo.provider.id"));
Assert.assertEquals("127.0.0.1", properties.get("dubbo.provider.host"));
- Assert.assertEquals("org.apache.dubbo.spring.boot.actuate.endpoint", properties.get("dubbo.scan.basePackages"));
+ Assert.assertEquals("org.apache.dubbo.spring.boot.actuate.autoconfigure", properties.get("dubbo.scan.basePackages"));
}
@Test
diff --git a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpointTest.java b/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpointTest.java
index 8634890..040ccf4 100644
--- a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpointTest.java
+++ b/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpointTest.java
@@ -17,11 +17,11 @@
package org.apache.dubbo.spring.boot.actuate.endpoint;
import org.apache.dubbo.spring.boot.util.DubboUtils;
-
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@@ -30,22 +30,23 @@
import static org.apache.dubbo.common.Version.getVersion;
/**
- * {@link DubboEndpoint} Test
+ * {@link DubboMetadataEndpoint} Test
*
- * @see DubboEndpoint
- * @since 1.0.0
+ * @see DubboMetadataEndpoint
+ * @since 2.7.0
*/
@RunWith(SpringRunner.class)
@SpringBootTest(
classes = {
- DubboEndpoint.class
+ DubboMetadataEndpoint.class
}
)
+@EnableAutoConfiguration
public class DubboEndpointTest {
@Autowired
- private DubboEndpoint dubboEndpoint;
+ private DubboMetadataEndpoint dubboEndpoint;
@Test
public void testInvoke() {
diff --git a/dubbo-spring-boot-autoconfigure/pom.xml b/dubbo-spring-boot-autoconfigure/pom.xml
index f50475a..83f1a4b 100644
--- a/dubbo-spring-boot-autoconfigure/pom.xml
+++ b/dubbo-spring-boot-autoconfigure/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -27,11 +28,19 @@
<artifactId>dubbo-spring-boot-autoconfigure</artifactId>
<packaging>jar</packaging>
- <name>Apache Dubbo Spring Boot Auto-Configure</name>
+ <name>Apache Dubbo Spring Boot :: Auto-Configure</name>
<description>Apache Dubbo Spring Boot Auto-Configure</description>
<dependencies>
+
+ <!-- Spring Boot Auto-Configuration -->
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-autoconfigure-compatible</artifactId>
+ <version>${revision}</version>
+ </dependency>
+
<!-- Spring Boot dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinder.java b/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/BinderDubboConfigBinder.java
similarity index 97%
rename from dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinder.java
rename to dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/BinderDubboConfigBinder.java
index 7c1dc87..b5d8962 100644
--- a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinder.java
+++ b/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/BinderDubboConfigBinder.java
@@ -19,7 +19,6 @@
import org.apache.dubbo.config.AbstractConfig;
import org.apache.dubbo.config.spring.context.properties.AbstractDubboConfigBinder;
import org.apache.dubbo.config.spring.context.properties.DubboConfigBinder;
-
import org.springframework.boot.context.properties.bind.BindHandler;
import org.springframework.boot.context.properties.bind.Bindable;
import org.springframework.boot.context.properties.bind.Binder;
@@ -36,9 +35,9 @@
* Spring Boot Relaxed {@link DubboConfigBinder} implementation
* see org.springframework.boot.context.properties.ConfigurationPropertiesBinder
*
- * @since 0.1.1
+ * @since 2.7.0
*/
-public class RelaxedDubboConfigBinder extends AbstractDubboConfigBinder {
+class BinderDubboConfigBinder extends AbstractDubboConfigBinder {
@Override
public <C extends AbstractConfig> void bind(String prefix, C dubboConfig) {
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
new file mode 100644
index 0000000..97aa275
--- /dev/null
+++ b/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java
@@ -0,0 +1,74 @@
+/*
+ * 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.spring.context.properties.DubboConfigBinder;
+import org.apache.dubbo.config.spring.util.PropertySourcesUtils;
+import org.springframework.boot.autoconfigure.AutoConfigureBefore;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.source.ConfigurationPropertySources;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Scope;
+import org.springframework.core.env.AbstractEnvironment;
+import org.springframework.core.env.ConfigurableEnvironment;
+import org.springframework.core.env.MapPropertySource;
+import org.springframework.core.env.MutablePropertySources;
+import org.springframework.core.env.PropertyResolver;
+
+import java.util.Map;
+
+import static org.apache.dubbo.spring.boot.util.DubboUtils.BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME;
+import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_PREFIX;
+import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_SCAN_PREFIX;
+import static org.apache.dubbo.spring.boot.util.DubboUtils.RELAXED_DUBBO_CONFIG_BINDER_BEAN_NAME;
+import static org.springframework.beans.factory.config.ConfigurableBeanFactory.SCOPE_PROTOTYPE;
+
+/**
+ * Dubbo Relaxed Binding Auto-{@link Configuration} for Spring Boot 2.0
+ *
+ * @see DubboRelaxedBindingAutoConfiguration
+ * @since 2.7.0
+ */
+@Configuration
+@ConditionalOnProperty(prefix = DUBBO_PREFIX, name = "enabled", matchIfMissing = true)
+@ConditionalOnClass(name = "org.springframework.boot.context.properties.bind.Binder")
+@AutoConfigureBefore(DubboRelaxedBindingAutoConfiguration.class)
+public class DubboRelaxedBinding2AutoConfiguration {
+
+ @Bean(name = BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME)
+ public PropertyResolver dubboScanBasePackagesPropertyResolver(ConfigurableEnvironment environment) {
+ ConfigurableEnvironment propertyResolver = new AbstractEnvironment() {
+ protected void customizePropertySources(MutablePropertySources propertySources) {
+ Map<String, Object> dubboScanProperties = PropertySourcesUtils.getSubProperties(environment, DUBBO_SCAN_PREFIX);
+ propertySources.addLast(new MapPropertySource("dubboScanProperties", dubboScanProperties));
+ }
+ };
+ ConfigurationPropertySources.attach(propertyResolver);
+ return propertyResolver;
+ }
+
+ @ConditionalOnMissingBean(name = RELAXED_DUBBO_CONFIG_BINDER_BEAN_NAME, value = DubboConfigBinder.class)
+ @Bean(RELAXED_DUBBO_CONFIG_BINDER_BEAN_NAME)
+ @Scope(scopeName = SCOPE_PROTOTYPE)
+ public DubboConfigBinder relaxedDubboConfigBinder() {
+ return new BinderDubboConfigBinder();
+ }
+
+}
diff --git a/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json b/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json
deleted file mode 100644
index 2b52009..0000000
--- a/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json
+++ /dev/null
@@ -1,1098 +0,0 @@
-{
- "hints": [],
- "groups": [],
- "properties": [
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.architecture",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.compiler",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.default",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.dump-directory",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.environment",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.id",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.logger",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.monitor",
- "type": "com.alibaba.dubbo.config.MonitorConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.name",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.organization",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.owner",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.parameters",
- "type": "java.util.Map<java.lang.String,java.lang.String>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.qos-accept-foreign-ip",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.qos-enable",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.qos-port",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.registries",
- "type": "java.util.List<com.alibaba.dubbo.config.RegistryConfig>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.registry",
- "type": "com.alibaba.dubbo.config.RegistryConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ApplicationConfig",
- "name": "dubbo.application.version",
- "type": "java.lang.String"
- },
- {
- "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties",
- "name": "dubbo.applications",
- "description": "Multiple {@link ApplicationConfig} property",
- "type": "java.util.Map<java.lang.String,com.alibaba.dubbo.config.ApplicationConfig>"
- },
- {
- "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": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.actives",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.application",
- "type": "com.alibaba.dubbo.config.ApplicationConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.async",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.cache",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.callbacks",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.check",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.client",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.cluster",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.connections",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.default",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.filter",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.generic",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.group",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.id",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.init",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "deprecated": true,
- "name": "dubbo.consumer.injvm",
- "type": "java.lang.Boolean",
- "deprecation": {}
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.layer",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.lazy",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.listener",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.loadbalance",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "deprecated": true,
- "name": "dubbo.consumer.local",
- "type": "java.lang.String",
- "deprecation": {}
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.merger",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.mock",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.module",
- "type": "com.alibaba.dubbo.config.ModuleConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.monitor",
- "type": "com.alibaba.dubbo.config.MonitorConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.onconnect",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.ondisconnect",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.owner",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.parameters",
- "type": "java.util.Map<java.lang.String,java.lang.String>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.proxy",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.reconnect",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.registries",
- "type": "java.util.List<com.alibaba.dubbo.config.RegistryConfig>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.registry",
- "type": "com.alibaba.dubbo.config.RegistryConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.retries",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.scope",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.sent",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.sticky",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.stub",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.timeout",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.validation",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ConsumerConfig",
- "name": "dubbo.consumer.version",
- "type": "java.lang.String"
- },
- {
- "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties",
- "name": "dubbo.consumers",
- "description": "Multiple {@link ConsumerConfig} property",
- "type": "java.util.Map<java.lang.String,com.alibaba.dubbo.config.ConsumerConfig>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ModuleConfig",
- "name": "dubbo.module.default",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ModuleConfig",
- "name": "dubbo.module.id",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ModuleConfig",
- "name": "dubbo.module.monitor",
- "type": "com.alibaba.dubbo.config.MonitorConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ModuleConfig",
- "name": "dubbo.module.name",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ModuleConfig",
- "name": "dubbo.module.organization",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ModuleConfig",
- "name": "dubbo.module.owner",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ModuleConfig",
- "name": "dubbo.module.registries",
- "type": "java.util.List<com.alibaba.dubbo.config.RegistryConfig>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ModuleConfig",
- "name": "dubbo.module.registry",
- "type": "com.alibaba.dubbo.config.RegistryConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ModuleConfig",
- "name": "dubbo.module.version",
- "type": "java.lang.String"
- },
- {
- "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties",
- "name": "dubbo.modules",
- "description": "Multiple {@link ModuleConfig} property",
- "type": "java.util.Map<java.lang.String,com.alibaba.dubbo.config.ModuleConfig>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.MonitorConfig",
- "name": "dubbo.monitor.address",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.MonitorConfig",
- "name": "dubbo.monitor.default",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.MonitorConfig",
- "name": "dubbo.monitor.group",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.MonitorConfig",
- "name": "dubbo.monitor.id",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.MonitorConfig",
- "name": "dubbo.monitor.parameters",
- "type": "java.util.Map<java.lang.String,java.lang.String>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.MonitorConfig",
- "name": "dubbo.monitor.password",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.MonitorConfig",
- "name": "dubbo.monitor.protocol",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.MonitorConfig",
- "name": "dubbo.monitor.username",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.MonitorConfig",
- "name": "dubbo.monitor.version",
- "type": "java.lang.String"
- },
- {
- "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties",
- "name": "dubbo.monitors",
- "description": "Multiple {@link MonitorConfig} property",
- "type": "java.util.Map<java.lang.String,com.alibaba.dubbo.config.MonitorConfig>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.accepts",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.accesslog",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.buffer",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.charset",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.client",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.codec",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.contextpath",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.default",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.dispatcher",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "deprecated": true,
- "name": "dubbo.protocol.dispather",
- "type": "java.lang.String",
- "deprecation": {}
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.exchanger",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.heartbeat",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.host",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.id",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.iothreads",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.name",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.networker",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.parameters",
- "type": "java.util.Map<java.lang.String,java.lang.String>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "deprecated": true,
- "name": "dubbo.protocol.path",
- "type": "java.lang.String",
- "deprecation": {}
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.payload",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.port",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.prompt",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.queues",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.register",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.serialization",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.server",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.status",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.telnet",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.threadpool",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.threads",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProtocolConfig",
- "name": "dubbo.protocol.transporter",
- "type": "java.lang.String"
- },
- {
- "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties",
- "name": "dubbo.protocols",
- "description": "Multiple {@link ProtocolConfig} property",
- "type": "java.util.Map<java.lang.String,com.alibaba.dubbo.config.ProtocolConfig>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.accepts",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.accesslog",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.actives",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.application",
- "type": "com.alibaba.dubbo.config.ApplicationConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.async",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.buffer",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.cache",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.callbacks",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.charset",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.client",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.cluster",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.codec",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.connections",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.contextpath",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "deprecated": true,
- "name": "dubbo.provider.default",
- "type": "java.lang.Boolean",
- "deprecation": {}
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.delay",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.deprecated",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.dispatcher",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "deprecated": true,
- "name": "dubbo.provider.dispather",
- "type": "java.lang.String",
- "deprecation": {}
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.document",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.dynamic",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.exchanger",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.executes",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.export",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.filter",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.group",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.host",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.id",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.iothreads",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.layer",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.listener",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.loadbalance",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "deprecated": true,
- "name": "dubbo.provider.local",
- "type": "java.lang.String",
- "deprecation": {}
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.merger",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.mock",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.module",
- "type": "com.alibaba.dubbo.config.ModuleConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.monitor",
- "type": "com.alibaba.dubbo.config.MonitorConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.networker",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.onconnect",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.ondisconnect",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.owner",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.parameters",
- "type": "java.util.Map<java.lang.String,java.lang.String>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "deprecated": true,
- "name": "dubbo.provider.path",
- "type": "java.lang.String",
- "deprecation": {}
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.payload",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "deprecated": true,
- "name": "dubbo.provider.port",
- "type": "java.lang.Integer",
- "deprecation": {}
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.prompt",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.protocol",
- "type": "com.alibaba.dubbo.config.ProtocolConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.protocols",
- "type": "java.util.List<com.alibaba.dubbo.config.ProtocolConfig>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.proxy",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.queues",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.register",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.registries",
- "type": "java.util.List<com.alibaba.dubbo.config.RegistryConfig>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.registry",
- "type": "com.alibaba.dubbo.config.RegistryConfig"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.retries",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.scope",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.sent",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.serialization",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.server",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.status",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.stub",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.telnet",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.threadpool",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.threads",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.timeout",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.token",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.transporter",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.validation",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.version",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.wait",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.warmup",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.ProviderConfig",
- "name": "dubbo.provider.weight",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties",
- "name": "dubbo.providers",
- "description": "Multiple {@link ProviderConfig} property",
- "type": "java.util.Map<java.lang.String,com.alibaba.dubbo.config.ProviderConfig>"
- },
- {
- "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties",
- "name": "dubbo.registries",
- "description": "Multiple {@link RegistryConfig} property",
- "type": "java.util.Map<java.lang.String,com.alibaba.dubbo.config.RegistryConfig>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.address",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.check",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.client",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.cluster",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.default",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.dynamic",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.file",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.group",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.id",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.parameters",
- "type": "java.util.Map<java.lang.String,java.lang.String>"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.password",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.port",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.protocol",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.register",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.server",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.session",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.subscribe",
- "type": "java.lang.Boolean"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.timeout",
- "type": "java.lang.Integer"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "deprecated": true,
- "name": "dubbo.registry.transport",
- "type": "java.lang.String",
- "deprecation": {}
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.transporter",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.username",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "name": "dubbo.registry.version",
- "type": "java.lang.String"
- },
- {
- "sourceType": "com.alibaba.dubbo.config.RegistryConfig",
- "deprecated": true,
- "name": "dubbo.registry.wait",
- "type": "java.lang.Integer",
- "deprecation": {}
- },
- {
- "sourceType": "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<java.lang.String>"
- }
- ]
-}
\ No newline at end of file
diff --git a/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories b/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories
index 1ef3d5b..c88a29b 100644
--- a/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories
+++ b/dubbo-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories
@@ -1,11 +1,2 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration
-
-
-org.springframework.context.ApplicationListener=\
-org.apache.dubbo.spring.boot.context.event.OverrideDubboConfigApplicationListener,\
-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.autoconfigure.DubboRelaxedBinding2AutoConfiguration
\ No newline at end of file
diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinderTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/BinderDubboConfigBinderTest.java
similarity index 90%
rename from dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinderTest.java
rename to dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/BinderDubboConfigBinderTest.java
index fa91c09..8005302 100644
--- a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinderTest.java
+++ b/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/BinderDubboConfigBinderTest.java
@@ -19,7 +19,6 @@
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ProtocolConfig;
import org.apache.dubbo.config.RegistryConfig;
-
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -29,17 +28,17 @@
import org.springframework.test.context.junit4.SpringRunner;
/**
- * {@link RelaxedDubboConfigBinder} Test
+ * {@link BinderDubboConfigBinder} Test
*
- * @since 0.1.1
+ * @since 2.7.0
*/
@RunWith(SpringRunner.class)
@TestPropertySource(locations = "classpath:/dubbo.properties")
-@ContextConfiguration(classes = RelaxedDubboConfigBinder.class)
-public class RelaxedDubboConfigBinderTest {
+@ContextConfiguration(classes = BinderDubboConfigBinder.class)
+public class BinderDubboConfigBinderTest {
@Autowired
- private RelaxedDubboConfigBinder dubboConfigBinder;
+ private BinderDubboConfigBinder dubboConfigBinder;
@Test
public void testBinder() {
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
new file mode 100644
index 0000000..4aee5a5
--- /dev/null
+++ b/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfigurationTest.java
@@ -0,0 +1,70 @@
+/*
+ * 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.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor;
+import org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor;
+import org.apache.dubbo.config.spring.context.properties.DubboConfigBinder;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.ObjectProvider;
+import org.springframework.beans.factory.annotation.Autowired;
+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.PropertyResolver;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.util.ClassUtils;
+
+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;
+
+/**
+ * {@link DubboRelaxedBinding2AutoConfiguration} Test
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = DubboRelaxedBinding2AutoConfigurationTest.class, properties = {
+ "dubbo.scan.basePackages = org.apache.dubbo.spring.boot.autoconfigure"
+})
+@EnableAutoConfiguration
+public class DubboRelaxedBinding2AutoConfigurationTest {
+
+ @Autowired
+ @Qualifier(BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME)
+ private PropertyResolver propertyResolver;
+
+ @Autowired
+ @Qualifier(RELAXED_DUBBO_CONFIG_BINDER_BEAN_NAME)
+ private DubboConfigBinder dubboConfigBinder;
+
+ @Autowired
+ private ObjectProvider<ServiceAnnotationBeanPostProcessor> serviceAnnotationBeanPostProcessor;
+
+ @Autowired
+ private ObjectProvider<ReferenceAnnotationBeanPostProcessor> referenceAnnotationBeanPostProcessor;
+
+ @Test
+ public void testBeans() {
+ Assert.assertTrue(ClassUtils.isAssignableValue(BinderDubboConfigBinder.class, dubboConfigBinder));
+ Assert.assertNotNull(serviceAnnotationBeanPostProcessor);
+ Assert.assertNotNull(serviceAnnotationBeanPostProcessor.getIfAvailable());
+ Assert.assertNotNull(referenceAnnotationBeanPostProcessor);
+ Assert.assertNotNull(referenceAnnotationBeanPostProcessor.getIfAvailable());
+ }
+
+}
diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/EnvironmentUtilsTest.java b/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/EnvironmentUtilsTest.java
index 805b225..2ca3766 100644
--- a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/EnvironmentUtilsTest.java
+++ b/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/EnvironmentUtilsTest.java
@@ -30,7 +30,7 @@
* {@link EnvironmentUtils} Test
*
* @see EnvironmentUtils
- * @since 1.0.0
+ * @since 2.7.0
*/
public class EnvironmentUtilsTest {
diff --git a/dubbo-spring-boot-compatible/actuator/pom.xml b/dubbo-spring-boot-compatible/actuator/pom.xml
new file mode 100644
index 0000000..60fbd2f
--- /dev/null
+++ b/dubbo-spring-boot-compatible/actuator/pom.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ 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">
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-compatible</artifactId>
+ <version>${revision}</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>dubbo-spring-boot-actuator-compatible</artifactId>
+ <name>Apache Dubbo Spring Boot :: Compatible :: Actuator</name>
+ <description>Apache Dubbo Spring Boot Compatible for Spring Boot 1.x Actuator</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-actuator</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-autoconfigure</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- @ConfigurationProperties annotation processing (metadata for IDEs) -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-configuration-processor</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Dubbo autoconfigure -->
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-autoconfigure-compatible</artifactId>
+ <version>${revision}</version>
+ </dependency>
+
+ <!-- Dubbo -->
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
\ No newline at end of file
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
new file mode 100644
index 0000000..a74cab1
--- /dev/null
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfiguration.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 org.apache.dubbo.spring.boot.actuate.autoconfigure;
+
+
+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.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Dubbo {@link Endpoint} Auto Configuration is compatible with Spring Boot Actuator 1.x
+ *
+ * @since 2.7.0
+ */
+@Configuration
+@ConditionalOnClass(name = {
+ "org.springframework.boot.actuate.endpoint.Endpoint" // Spring Boot 1.x
+})
+@AutoConfigureAfter(value = {
+ DubboAutoConfiguration.class,
+ DubboRelaxedBindingAutoConfiguration.class
+})
+public class DubboEndpointAutoConfiguration {
+
+ @Bean
+ @ConditionalOnMissingBean
+ @ConditionalOnEnabledEndpoint(value = "dubbo")
+ public DubboEndpoint dubboEndpoint() {
+ return new DubboEndpoint();
+ }
+}
diff --git a/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointMetadataAutoConfiguration.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointMetadataAutoConfiguration.java
new file mode 100644
index 0000000..d525e98
--- /dev/null
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointMetadataAutoConfiguration.java
@@ -0,0 +1,38 @@
+/*
+ * 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.actuate.autoconfigure;
+
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.AbstractDubboMetadata;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Dubbo Endpoints Metadata Auto-{@link Configuration}
+ */
+@ConditionalOnClass(name = {
+ "org.springframework.boot.actuate.health.Health" // If spring-boot-actuator is present
+})
+@Configuration
+@AutoConfigureAfter(name = {
+ "org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration",
+ "org.apache.dubbo.spring.boot.autoconfigure.DubboRelaxedBindingAutoConfiguration"
+})
+@ComponentScan(basePackageClasses = AbstractDubboMetadata.class)
+public class DubboEndpointMetadataAutoConfiguration {
+}
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboHealthIndicatorAutoConfiguration.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboHealthIndicatorAutoConfiguration.java
similarity index 74%
rename from dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboHealthIndicatorAutoConfiguration.java
rename to dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboHealthIndicatorAutoConfiguration.java
index 0422fea..333954b 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboHealthIndicatorAutoConfiguration.java
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboHealthIndicatorAutoConfiguration.java
@@ -18,15 +18,10 @@
import org.apache.dubbo.spring.boot.actuate.health.DubboHealthIndicator;
import org.apache.dubbo.spring.boot.actuate.health.DubboHealthIndicatorProperties;
-import org.apache.dubbo.spring.boot.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;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
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;
@@ -35,13 +30,13 @@
* Dubbo {@link DubboHealthIndicator} Auto Configuration
*
* @see HealthIndicator
- * @since 1.0.0
+ * @since 2.7.0
*/
@Configuration
-@ConditionalOnClass({HealthIndicator.class})
-@AutoConfigureBefore({EndpointAutoConfiguration.class})
-@AutoConfigureAfter(DubboAutoConfiguration.class)
-@ConditionalOnEnabledHealthIndicator("dubbo")
+@ConditionalOnClass(name = {
+ "org.springframework.boot.actuate.health.Health"
+})
+@ConditionalOnProperty(name = "management.health.dubbo.enabled", matchIfMissing = true, havingValue = "true")
@EnableConfigurationProperties(DubboHealthIndicatorProperties.class)
public class DubboHealthIndicatorAutoConfiguration {
diff --git a/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.java
new file mode 100644
index 0000000..cfe537c
--- /dev/null
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboMvcEndpointManagementContextConfiguration.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.actuate.autoconfigure;
+
+
+import org.apache.dubbo.spring.boot.actuate.endpoint.DubboEndpoint;
+import org.apache.dubbo.spring.boot.actuate.endpoint.mvc.DubboMvcEndpoint;
+import org.springframework.boot.actuate.autoconfigure.ManagementContextConfiguration;
+import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
+import org.springframework.context.annotation.Bean;
+
+/**
+ * Dubbo {@link MvcEndpoint} {@link ManagementContextConfiguration} for Spring Boot 1.x
+ *
+ * @since 2.7.0
+ */
+@ManagementContextConfiguration
+@ConditionalOnClass(name = {
+ "org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter"
+})
+@ConditionalOnWebApplication
+public class DubboMvcEndpointManagementContextConfiguration {
+
+ @Bean
+ @ConditionalOnBean(DubboEndpoint.class)
+ @ConditionalOnMissingBean
+ public DubboMvcEndpoint dubboMvcEndpoint(DubboEndpoint dubboEndpoint) {
+ return new DubboMvcEndpoint(dubboEndpoint);
+ }
+}
diff --git a/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpoint.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpoint.java
new file mode 100644
index 0000000..0e0aa75
--- /dev/null
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpoint.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.actuate.endpoint;
+
+
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboMetadata;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.actuate.endpoint.AbstractEndpoint;
+import org.springframework.boot.actuate.endpoint.Endpoint;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+import java.util.Map;
+
+/**
+ * Actuator {@link Endpoint} to expose Dubbo Meta Data
+ *
+ * @see Endpoint
+ * @since 2.7.0
+ */
+@ConfigurationProperties(prefix = "endpoints.dubbo", ignoreUnknownFields = false)
+public class DubboEndpoint extends AbstractEndpoint<Map<String, Object>> {
+
+ @Autowired
+ private DubboMetadata dubboMetadata;
+
+ public DubboEndpoint() {
+ super("dubbo", true, false);
+ }
+
+ @Override
+ public Map<String, Object> invoke() {
+ return dubboMetadata.invoke();
+ }
+}
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/AbstractDubboEndpoint.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/AbstractDubboMetadata.java
similarity index 93%
rename from dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/AbstractDubboEndpoint.java
rename to dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/AbstractDubboMetadata.java
index eae99b4..fb4e01f 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/AbstractDubboEndpoint.java
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/AbstractDubboMetadata.java
@@ -14,14 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.spring.boot.actuate.endpoint;
+package org.apache.dubbo.spring.boot.actuate.endpoint.metadata;
import org.apache.dubbo.config.ProtocolConfig;
import org.apache.dubbo.config.spring.ServiceBean;
import org.apache.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;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.EnvironmentAware;
@@ -44,11 +42,11 @@
import static org.springframework.util.ClassUtils.isPrimitiveOrWrapper;
/**
- * Abstract Dubbo {@link Endpoint @Endpoint}
+ * Abstract Dubbo Meatadata
*
- * @since 0.2.0
+ * @since 2.7.0
*/
-public abstract class AbstractDubboEndpoint implements ApplicationContextAware, EnvironmentAware {
+public abstract class AbstractDubboMetadata implements ApplicationContextAware, EnvironmentAware {
protected ApplicationContext applicationContext;
diff --git a/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboConfigsMetadata.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboConfigsMetadata.java
new file mode 100644
index 0000000..46de93e
--- /dev/null
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboConfigsMetadata.java
@@ -0,0 +1,86 @@
+/*
+ * 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.actuate.endpoint.metadata;
+
+import org.apache.dubbo.config.AbstractConfig;
+import org.apache.dubbo.config.ApplicationConfig;
+import org.apache.dubbo.config.ConsumerConfig;
+import org.apache.dubbo.config.MethodConfig;
+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.ReferenceConfig;
+import org.apache.dubbo.config.RegistryConfig;
+import org.apache.dubbo.config.ServiceConfig;
+import org.springframework.stereotype.Component;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+import static org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors;
+
+/**
+ * Dubbo Configs Metadata
+ *
+ * @since 2.7.0
+ */
+@Component
+public class DubboConfigsMetadata extends AbstractDubboMetadata {
+
+ public Map<String, Map<String, Map<String, Object>>> configs() {
+
+ Map<String, Map<String, Map<String, Object>>> configsMap = new LinkedHashMap<>();
+
+ addDubboConfigBeans(ApplicationConfig.class, configsMap);
+ addDubboConfigBeans(ConsumerConfig.class, configsMap);
+ addDubboConfigBeans(MethodConfig.class, configsMap);
+ addDubboConfigBeans(ModuleConfig.class, configsMap);
+ addDubboConfigBeans(MonitorConfig.class, configsMap);
+ addDubboConfigBeans(ProtocolConfig.class, configsMap);
+ addDubboConfigBeans(ProviderConfig.class, configsMap);
+ addDubboConfigBeans(ReferenceConfig.class, configsMap);
+ addDubboConfigBeans(RegistryConfig.class, configsMap);
+ addDubboConfigBeans(ServiceConfig.class, configsMap);
+
+ return configsMap;
+
+ }
+
+ private void addDubboConfigBeans(Class<? extends AbstractConfig> dubboConfigClass,
+ Map<String, Map<String, Map<String, Object>>> configsMap) {
+
+ Map<String, ? extends AbstractConfig> dubboConfigBeans = beansOfTypeIncludingAncestors(applicationContext, dubboConfigClass);
+
+ String name = dubboConfigClass.getSimpleName();
+
+ Map<String, Map<String, Object>> beansMetadata = new TreeMap<>();
+
+ for (Map.Entry<String, ? extends AbstractConfig> entry : dubboConfigBeans.entrySet()) {
+
+ String beanName = entry.getKey();
+ AbstractConfig configBean = entry.getValue();
+ Map<String, Object> configBeanMeta = resolveBeanMetadata(configBean);
+ beansMetadata.put(beanName, configBeanMeta);
+
+ }
+
+ configsMap.put(name, beansMetadata);
+
+ }
+}
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpoint.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboMetadata.java
similarity index 85%
rename from dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpoint.java
rename to dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboMetadata.java
index 34d2a9b..cf08180 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpoint.java
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboMetadata.java
@@ -14,13 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.spring.boot.actuate.endpoint;
+package org.apache.dubbo.spring.boot.actuate.endpoint.metadata;
import org.apache.dubbo.common.Version;
import org.apache.dubbo.spring.boot.util.DubboUtils;
-
-import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
-import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
+import org.springframework.stereotype.Component;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -32,15 +30,12 @@
import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_SPRING_BOOT_ISSUES_URL;
/**
- * Actuator {@link Endpoint} to expose Dubbo Meta Data
- *
- * @see Endpoint
- * @since 1.0.0
+ * Dubbo Metadata
+ * @since 2.7.0
*/
-@Endpoint(id = "dubbo")
-public class DubboEndpoint {
+@Component
+public class DubboMetadata {
- @ReadOperation
public Map<String, Object> invoke() {
Map<String, Object> metaData = new LinkedHashMap<>();
@@ -63,5 +58,4 @@
return metaData;
}
-
}
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboPropertiesEndpoint.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboPropertiesMetadata.java
similarity index 72%
rename from dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboPropertiesEndpoint.java
rename to dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboPropertiesMetadata.java
index 65de76d..3749a06 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboPropertiesEndpoint.java
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboPropertiesMetadata.java
@@ -14,28 +14,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.spring.boot.actuate.endpoint;
+package org.apache.dubbo.spring.boot.actuate.endpoint.metadata;
-import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
-import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
+import org.springframework.stereotype.Component;
import java.util.SortedMap;
import static org.apache.dubbo.spring.boot.util.DubboUtils.filterDubboProperties;
/**
- * Dubbo Properties {@link Endpoint}
+ * Dubbo Properties Metadata
*
- * @since 1.0.0
+ * @since 2.7.0
*/
-@Endpoint(id = "dubboproperties")
-public class DubboPropertiesEndpoint extends AbstractDubboEndpoint {
+@Component
+public class DubboPropertiesMetadata extends AbstractDubboMetadata {
- @ReadOperation
public SortedMap<String, Object> properties() {
-
return filterDubboProperties(environment);
-
}
-
-}
+}
\ No newline at end of file
diff --git a/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboReferencesMetadata.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboReferencesMetadata.java
new file mode 100644
index 0000000..e389a6a
--- /dev/null
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboReferencesMetadata.java
@@ -0,0 +1,70 @@
+/*
+ * 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.actuate.endpoint.metadata;
+
+import org.apache.dubbo.config.annotation.Reference;
+import org.apache.dubbo.config.spring.ReferenceBean;
+import org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor;
+import org.springframework.beans.factory.annotation.InjectionMetadata;
+import org.springframework.stereotype.Component;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * Dubbo {@link Reference} Metadata
+ *
+ * @since 2.7.0
+ */
+@Component
+public class DubboReferencesMetadata extends AbstractDubboMetadata {
+
+ public Map<String, Map<String, Object>> references() {
+
+ Map<String, Map<String, Object>> referencesMetadata = new LinkedHashMap<>();
+
+ ReferenceAnnotationBeanPostProcessor beanPostProcessor = getReferenceAnnotationBeanPostProcessor();
+
+ referencesMetadata.putAll(buildReferencesMetadata(beanPostProcessor.getInjectedFieldReferenceBeanMap()));
+ referencesMetadata.putAll(buildReferencesMetadata(beanPostProcessor.getInjectedMethodReferenceBeanMap()));
+
+ return referencesMetadata;
+
+ }
+
+ private Map<String, Map<String, Object>> buildReferencesMetadata(
+ Map<InjectionMetadata.InjectedElement, ReferenceBean<?>> injectedElementReferenceBeanMap) {
+ Map<String, Map<String, Object>> referencesMetadata = new LinkedHashMap<>();
+
+ for (Map.Entry<InjectionMetadata.InjectedElement, ReferenceBean<?>> entry :
+ injectedElementReferenceBeanMap.entrySet()) {
+
+ InjectionMetadata.InjectedElement injectedElement = entry.getKey();
+
+ ReferenceBean<?> referenceBean = entry.getValue();
+
+ Map<String, Object> beanMetadata = resolveBeanMetadata(referenceBean);
+ beanMetadata.put("invoker", resolveBeanMetadata(referenceBean.get()));
+
+ referencesMetadata.put(String.valueOf(injectedElement.getMember()), beanMetadata);
+
+ }
+
+ return referencesMetadata;
+ }
+
+}
diff --git a/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboServicesMetadata.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboServicesMetadata.java
new file mode 100644
index 0000000..7122e36
--- /dev/null
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboServicesMetadata.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.actuate.endpoint.metadata;
+
+import org.apache.dubbo.config.annotation.Service;
+import org.apache.dubbo.config.spring.ServiceBean;
+import org.springframework.stereotype.Component;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * Dubbo {@link Service} Metadata
+ *
+ * @since 2.7.0
+ */
+@Component
+public class DubboServicesMetadata extends AbstractDubboMetadata {
+
+ public Map<String, Map<String, Object>> services() {
+
+ Map<String, ServiceBean> serviceBeansMap = getServiceBeansMap();
+
+ Map<String, Map<String, Object>> servicesMetadata = new LinkedHashMap<>(serviceBeansMap.size());
+
+ for (Map.Entry<String, ServiceBean> entry : serviceBeansMap.entrySet()) {
+
+ String serviceBeanName = entry.getKey();
+
+ ServiceBean serviceBean = entry.getValue();
+
+ Map<String, Object> serviceBeanMetadata = resolveBeanMetadata(serviceBean);
+
+ Object service = resolveServiceBean(serviceBeanName, serviceBean);
+
+ if (service != null) {
+ // Add Service implementation class
+ serviceBeanMetadata.put("serviceClass", service.getClass().getName());
+ }
+
+ servicesMetadata.put(serviceBeanName, serviceBeanMetadata);
+
+ }
+
+ return servicesMetadata;
+
+ }
+
+ private Object resolveServiceBean(String serviceBeanName, ServiceBean serviceBean) {
+
+ int index = serviceBeanName.indexOf("#");
+
+ if (index > -1) {
+
+ Class<?> interfaceClass = serviceBean.getInterfaceClass();
+
+ String serviceName = serviceBeanName.substring(index + 1);
+
+ if (applicationContext.containsBean(serviceName)) {
+ return applicationContext.getBean(serviceName, interfaceClass);
+ }
+
+ }
+
+ return null;
+
+ }
+
+}
diff --git a/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboShutdownMetadata.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboShutdownMetadata.java
new file mode 100644
index 0000000..225c324
--- /dev/null
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/metadata/DubboShutdownMetadata.java
@@ -0,0 +1,77 @@
+/*
+ * 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.actuate.endpoint.metadata;
+
+import org.apache.dubbo.config.spring.ServiceBean;
+import org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor;
+import org.springframework.stereotype.Component;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+import static org.apache.dubbo.registry.support.AbstractRegistryFactory.getRegistries;
+
+/**
+ * Dubbo Shutdown
+ *
+ * @since 2.7.0
+ */
+@Component
+public class DubboShutdownMetadata extends AbstractDubboMetadata {
+
+
+ public Map<String, Object> shutdown() throws Exception {
+
+ Map<String, Object> shutdownCountData = new LinkedHashMap<>();
+
+ // registries
+ int registriesCount = getRegistries().size();
+
+ // protocols
+ int protocolsCount = getProtocolConfigsBeanMap().size();
+
+ shutdownCountData.put("registries", registriesCount);
+ shutdownCountData.put("protocols", protocolsCount);
+
+ // Service Beans
+ Map<String, ServiceBean> serviceBeansMap = getServiceBeansMap();
+ if (!serviceBeansMap.isEmpty()) {
+ for (ServiceBean serviceBean : serviceBeansMap.values()) {
+ serviceBean.destroy();
+ }
+ }
+ shutdownCountData.put("services", serviceBeansMap.size());
+
+ // Reference Beans
+ ReferenceAnnotationBeanPostProcessor beanPostProcessor = getReferenceAnnotationBeanPostProcessor();
+
+ int referencesCount = beanPostProcessor.getReferenceBeans().size();
+
+ beanPostProcessor.destroy();
+
+ shutdownCountData.put("references", referencesCount);
+
+ // Set Result to complete
+ Map<String, Object> shutdownData = new TreeMap<>();
+ shutdownData.put("shutdown.count", shutdownCountData);
+
+
+ return shutdownData;
+ }
+
+}
diff --git a/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/mvc/DubboMvcEndpoint.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/mvc/DubboMvcEndpoint.java
new file mode 100644
index 0000000..fb23504
--- /dev/null
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/endpoint/mvc/DubboMvcEndpoint.java
@@ -0,0 +1,111 @@
+/*
+ * 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.actuate.endpoint.mvc;
+
+import org.apache.dubbo.spring.boot.actuate.endpoint.DubboEndpoint;
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboConfigsMetadata;
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboPropertiesMetadata;
+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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter;
+import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.context.request.async.DeferredResult;
+
+import java.util.Map;
+import java.util.SortedMap;
+
+/**
+ * {@link MvcEndpoint} to expose Dubbo Metadata
+ *
+ * @see MvcEndpoint
+ * @since 2.7.0
+ */
+public class DubboMvcEndpoint extends EndpointMvcAdapter {
+
+ public static final String DUBBO_SHUTDOWN_ENDPOINT_URI = "/shutdown";
+
+ public static final String DUBBO_CONFIGS_ENDPOINT_URI = "/configs";
+
+ public static final String DUBBO_SERVICES_ENDPOINT_URI = "/services";
+
+ public static final String DUBBO_REFERENCES_ENDPOINT_URI = "/references";
+
+ public static final String DUBBO_PROPERTIES_ENDPOINT_URI = "/properties";
+
+ private final Logger logger = LoggerFactory.getLogger(getClass());
+
+ @Autowired
+ private DubboShutdownMetadata dubboShutdownMetadata;
+
+ @Autowired
+ private DubboConfigsMetadata dubboConfigsMetadata;
+
+ @Autowired
+ private DubboServicesMetadata dubboServicesMetadata;
+
+ @Autowired
+ private DubboReferencesMetadata dubboReferencesMetadata;
+
+ @Autowired
+ private DubboPropertiesMetadata dubboPropertiesMetadata;
+
+ public DubboMvcEndpoint(DubboEndpoint dubboEndpoint) {
+ super(dubboEndpoint);
+ }
+
+
+ @RequestMapping(value = DUBBO_SHUTDOWN_ENDPOINT_URI, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
+ @ResponseBody
+ public DeferredResult shutdown() throws Exception {
+ Map<String, Object> shutdownCountData = dubboShutdownMetadata.shutdown();
+ return new DeferredResult(null, shutdownCountData);
+ }
+
+ @RequestMapping(value = DUBBO_CONFIGS_ENDPOINT_URI, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ @ResponseBody
+ public Map<String, Map<String, Map<String, Object>>> configs() {
+ return dubboConfigsMetadata.configs();
+ }
+
+
+ @RequestMapping(value = DUBBO_SERVICES_ENDPOINT_URI, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ @ResponseBody
+ public Map<String, Map<String, Object>> services() {
+ return dubboServicesMetadata.services();
+ }
+
+ @RequestMapping(value = DUBBO_REFERENCES_ENDPOINT_URI, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ @ResponseBody
+ public Map<String, Map<String, Object>> references() {
+ return dubboReferencesMetadata.references();
+ }
+
+ @RequestMapping(value = DUBBO_PROPERTIES_ENDPOINT_URI, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ @ResponseBody
+ public SortedMap<String, Object> properties() {
+ return dubboPropertiesMetadata.properties();
+
+ }
+}
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicator.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicator.java
similarity index 99%
rename from dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicator.java
rename to dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicator.java
index 2b2cf17..c937dc6 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicator.java
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicator.java
@@ -20,7 +20,6 @@
import org.apache.dubbo.common.status.StatusChecker;
import org.apache.dubbo.config.ProtocolConfig;
import org.apache.dubbo.config.ProviderConfig;
-
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
@@ -38,7 +37,7 @@
* Dubbo {@link HealthIndicator}
*
* @see HealthIndicator
- * @since 1.0.0
+ * @since 2.7.0
*/
public class DubboHealthIndicator extends AbstractHealthIndicator {
diff --git a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicatorProperties.java b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicatorProperties.java
similarity index 99%
rename from dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicatorProperties.java
rename to dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicatorProperties.java
index d931b19..7699293 100644
--- a/dubbo-spring-boot-actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicatorProperties.java
+++ b/dubbo-spring-boot-compatible/actuator/src/main/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicatorProperties.java
@@ -17,7 +17,6 @@
package org.apache.dubbo.spring.boot.actuate.health;
import org.apache.dubbo.common.status.StatusChecker;
-
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -31,7 +30,7 @@
* Dubbo {@link HealthIndicator} Properties
*
* @see HealthIndicator
- * @since 1.0.0
+ * @since 2.7.0
*/
@ConfigurationProperties(prefix = PREFIX, ignoreUnknownFields = false)
public class DubboHealthIndicatorProperties {
diff --git a/dubbo-spring-boot-compatible/actuator/src/main/resources/META-INF/spring.factories b/dubbo-spring-boot-compatible/actuator/src/main/resources/META-INF/spring.factories
new file mode 100644
index 0000000..bea4633
--- /dev/null
+++ b/dubbo-spring-boot-compatible/actuator/src/main/resources/META-INF/spring.factories
@@ -0,0 +1,6 @@
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAutoConfiguration,\
+org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboHealthIndicatorAutoConfiguration,\
+org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointMetadataAutoConfiguration
+org.springframework.boot.actuate.autoconfigure.ManagementContextConfiguration=\
+org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboMvcEndpointManagementContextConfiguration
\ No newline at end of file
diff --git a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java b/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java
similarity index 75%
copy from dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java
copy to dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java
index 39d06e7..9f5f51e 100644
--- a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/endpoint/DubboEndpointsAutoConfigurationTest.java
+++ b/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java
@@ -14,13 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.spring.boot.actuate.endpoint;
-
-import org.apache.dubbo.config.annotation.Service;
-import org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointsAutoConfiguration;
+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;
+import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboPropertiesMetadata;
+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 org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -36,15 +40,15 @@
import java.util.function.Supplier;
/**
- * {@link DubboEndpointsAutoConfiguration} Test
+ * {@link DubboEndpointAutoConfiguration} Test
*
- * @since 0.2.0
+ * @since 2.7.0
*/
@RunWith(SpringRunner.class)
@SpringBootTest(
classes = {
- DubboEndpointsAutoConfiguration.class,
- DubboEndpointsAutoConfigurationTest.class
+ DubboEndpointAutoConfiguration.class,
+ DubboEndpointAutoConfigurationTest.class
},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = {
@@ -60,48 +64,51 @@
"dubbo.protocol.port=20880",
"dubbo.provider.id=my-provider",
"dubbo.provider.host=127.0.0.1",
- "dubbo.scan.basePackages= org.apache.dubbo.spring.boot.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.endpoints.web.exposure.include = *",
+ "dubbo.scan.basePackages=org.apache.dubbo.spring.boot.actuate.autoconfigure",
+ "endpoints.enabled = true",
+ "management.security.enabled = false",
+ "management.contextPath = /actuator",
+ "endpoints.dubbo.enabled = true",
+ "endpoints.dubbo.sensitive = false",
+ "endpoints.dubboshutdown.enabled = true",
+ "endpoints.dubboconfigs.enabled = true",
+ "endpoints.dubboservices.enabled = true",
+ "endpoints.dubboreferences.enabled = true",
+ "endpoints.dubboproperties.enabled = true",
})
@EnableAutoConfiguration
-public class DubboEndpointsAutoConfigurationTest {
+public class DubboEndpointAutoConfigurationTest {
@Autowired
private DubboEndpoint dubboEndpoint;
@Autowired
- private DubboConfigsMetadataEndpoint dubboConfigsMetadataEndpoint;
+ private DubboConfigsMetadata dubboConfigsMetadata;
@Autowired
- private DubboPropertiesEndpoint dubboPropertiesEndpoint;
+ private DubboPropertiesMetadata dubboProperties;
@Autowired
- private DubboReferencesMetadataEndpoint dubboReferencesMetadataEndpoint;
+ private DubboReferencesMetadata dubboReferencesMetadata;
@Autowired
- private DubboServicesMetadataEndpoint dubboServicesMetadataEndpoint;
+ private DubboServicesMetadata dubboServicesMetadata;
@Autowired
- private DubboShutdownEndpoint dubboShutdownEndpoint;
+ private DubboShutdownMetadata dubboShutdownMetadata;
private RestTemplate restTemplate = new RestTemplate();
@Autowired
private ObjectMapper objectMapper;
- @Value("http://127.0.0.1:${local.management.port}${management.endpoints.web.base-path:/actuator}")
+ @Value("http://127.0.0.1:${local.management.port}${management.contextPath:}")
private String actuatorBaseURL;
@Test
public void testShutdown() throws Exception {
- Map<String, Object> value = dubboShutdownEndpoint.shutdown();
+ Map<String, Object> value = dubboShutdownMetadata.shutdown();
Map<String, Object> shutdownCounts = (Map<String, Object>) value.get("shutdown.count");
@@ -115,7 +122,7 @@
@Test
public void testConfigs() {
- Map<String, Map<String, Map<String, Object>>> configsMap = dubboConfigsMetadataEndpoint.configs();
+ Map<String, Map<String, Map<String, Object>>> configsMap = dubboConfigsMetadata.configs();
Map<String, Map<String, Object>> beansMetadata = configsMap.get("ApplicationConfig");
Assert.assertEquals("dubbo-demo-application", beansMetadata.get("my-application").get("name"));
@@ -152,11 +159,11 @@
@Test
public void testServices() {
- Map<String, Map<String, Object>> services = dubboServicesMetadataEndpoint.services();
+ Map<String, Map<String, Object>> services = dubboServicesMetadata.services();
Assert.assertEquals(1, services.size());
- Map<String, Object> demoServiceMeta = services.get("ServiceBean:org.apache.dubbo.spring.boot.actuate.endpoint.DubboEndpointsAutoConfigurationTest$DemoService:1.0.0");
+ Map<String, Object> demoServiceMeta = services.get("ServiceBean:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAutoConfigurationTest$DemoService:1.0.0");
Assert.assertEquals("1.0.0", demoServiceMeta.get("version"));
@@ -165,7 +172,7 @@
@Test
public void testReferences() {
- Map<String, Map<String, Object>> references = dubboReferencesMetadataEndpoint.references();
+ Map<String, Map<String, Object>> references = dubboReferencesMetadata.references();
Assert.assertTrue(references.isEmpty());
@@ -174,7 +181,7 @@
@Test
public void testProperties() {
- SortedMap<String, Object> properties = dubboPropertiesEndpoint.properties();
+ SortedMap<String, Object> properties = dubboProperties.properties();
Assert.assertEquals("my-application", properties.get("dubbo.application.id"));
Assert.assertEquals("dubbo-demo-application", properties.get("dubbo.application.name"));
@@ -187,16 +194,16 @@
Assert.assertEquals("20880", properties.get("dubbo.protocol.port"));
Assert.assertEquals("my-provider", properties.get("dubbo.provider.id"));
Assert.assertEquals("127.0.0.1", properties.get("dubbo.provider.host"));
- Assert.assertEquals("org.apache.dubbo.spring.boot.actuate.endpoint", properties.get("dubbo.scan.basePackages"));
+ Assert.assertEquals("org.apache.dubbo.spring.boot.actuate.autoconfigure", 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);
+ testHttpEndpoint("/dubbo/configs", dubboConfigsMetadata::configs);
+ testHttpEndpoint("/dubbo/services", dubboServicesMetadata::services);
+ testHttpEndpoint("/dubbo/references", dubboReferencesMetadata::references);
+ testHttpEndpoint("/dubbo/properties", dubboProperties::properties);
}
private void testHttpEndpoint(String actuatorURI, Supplier<Map> resultsSupplier) throws JsonProcessingException {
diff --git a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicatorTest.java b/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicatorTest.java
similarity index 95%
rename from dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicatorTest.java
rename to dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicatorTest.java
index 6a2efe3..a3ac06d 100644
--- a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicatorTest.java
+++ b/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/health/DubboHealthIndicatorTest.java
@@ -17,7 +17,6 @@
package org.apache.dubbo.spring.boot.actuate.health;
import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig;
-
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -27,7 +26,7 @@
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit4.SpringRunner;
import java.util.Map;
@@ -35,9 +34,9 @@
* {@link DubboHealthIndicator} Test
*
* @see DubboHealthIndicator
- * @since 1.0.0
+ * @since 2.7.0
*/
-@RunWith(SpringJUnit4ClassRunner.class)
+@RunWith(SpringRunner.class)
@TestPropertySource(properties = {
"dubbo.protocol.id = dubbo-protocol",
"dubbo.protocol.name = dubbo",
diff --git a/dubbo-spring-boot-compatible/autoconfigure/pom.xml b/dubbo-spring-boot-compatible/autoconfigure/pom.xml
new file mode 100644
index 0000000..f1b0e12
--- /dev/null
+++ b/dubbo-spring-boot-compatible/autoconfigure/pom.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ 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">
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-compatible</artifactId>
+ <version>${revision}</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>dubbo-spring-boot-autoconfigure-compatible</artifactId>
+ <name>Apache Dubbo Spring Boot :: Compatible :: Auto-Configure</name>
+ <description>Apache Dubbo Spring Boot Compatible for Spring Boot 1.x Auto-Configure</description>
+
+
+ <dependencies>
+
+ <!-- Spring Boot dependencies -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-autoconfigure</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- @ConfigurationProperties annotation processing (metadata for IDEs) -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-configuration-processor</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Dubbo -->
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/dubbo-spring-boot-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
similarity index 70%
rename from dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java
index d90bd0d..f49e49e 100644
--- a/dubbo-spring-boot-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
@@ -16,72 +16,60 @@
*/
package org.apache.dubbo.spring.boot.autoconfigure;
-import org.apache.dubbo.config.AbstractConfig;
-import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.annotation.Reference;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor;
import org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor;
-import org.apache.dubbo.config.spring.context.annotation.DubboComponentScan;
import org.apache.dubbo.config.spring.context.annotation.DubboConfigConfiguration;
-import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.apache.dubbo.config.spring.context.annotation.EnableDubboConfig;
-
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+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.bind.Binder;
-import org.springframework.boot.context.properties.source.ConfigurationPropertySources;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Scope;
-import org.springframework.core.env.Environment;
+import org.springframework.core.env.PropertyResolver;
import java.util.Set;
import static java.util.Collections.emptySet;
import static org.apache.dubbo.spring.boot.util.DubboUtils.BASE_PACKAGES_PROPERTY_NAME;
+import static org.apache.dubbo.spring.boot.util.DubboUtils.BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME;
+import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_CONFIG_PREFIX;
import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_PREFIX;
+import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_SCAN_PREFIX;
import static org.apache.dubbo.spring.boot.util.DubboUtils.MULTIPLE_CONFIG_PROPERTY_NAME;
-import static org.springframework.beans.factory.config.ConfigurableBeanFactory.SCOPE_PROTOTYPE;
/**
* Dubbo Auto {@link Configuration}
*
- * @see ApplicationConfig
- * @see Service
* @see Reference
- * @see DubboComponentScan
- * @see EnableDubboConfig
- * @see EnableDubbo
- * @since 1.0.0
+ * @see Service
+ * @see ServiceAnnotationBeanPostProcessor
+ * @see ReferenceAnnotationBeanPostProcessor
+ * @since 2.7.0
*/
+@ConditionalOnProperty(prefix = DUBBO_PREFIX, name = "enabled", matchIfMissing = true)
@Configuration
-@ConditionalOnProperty(prefix = DUBBO_PREFIX, name = "enabled", matchIfMissing = true, havingValue = "true")
-@ConditionalOnClass(AbstractConfig.class)
+@AutoConfigureAfter(DubboRelaxedBindingAutoConfiguration.class)
public class DubboAutoConfiguration {
/**
* Creates {@link ServiceAnnotationBeanPostProcessor} Bean
*
- * @param environment {@link Environment} Bean
+ * @param propertyResolver {@link PropertyResolver} Bean
* @return {@link ServiceAnnotationBeanPostProcessor}
*/
- @ConditionalOnProperty(name = BASE_PACKAGES_PROPERTY_NAME)
- @ConditionalOnClass(ConfigurationPropertySources.class)
+ @ConditionalOnProperty(prefix = DUBBO_SCAN_PREFIX, name = BASE_PACKAGES_PROPERTY_NAME)
+ @ConditionalOnBean(name = BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME)
@Bean
- public ServiceAnnotationBeanPostProcessor serviceAnnotationBeanPostProcessor(Environment environment) {
- Set<String> packagesToScan = environment.getProperty(BASE_PACKAGES_PROPERTY_NAME, Set.class, emptySet());
+ public ServiceAnnotationBeanPostProcessor serviceAnnotationBeanPostProcessor(
+ @Qualifier(BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME) PropertyResolver propertyResolver) {
+ Set<String> packagesToScan = propertyResolver.getProperty(BASE_PACKAGES_PROPERTY_NAME, Set.class, emptySet());
return new ServiceAnnotationBeanPostProcessor(packagesToScan);
}
- @ConditionalOnClass(Binder.class)
- @Bean
- @Scope(scopeName = SCOPE_PROTOTYPE)
- public RelaxedDubboConfigBinder relaxedDubboConfigBinder() {
- return new RelaxedDubboConfigBinder();
- }
-
/**
* Creates {@link ReferenceAnnotationBeanPostProcessor} Bean if Absent
*
@@ -109,7 +97,7 @@
* @see EnableDubboConfig
* @see DubboConfigConfiguration.Multiple
*/
- @ConditionalOnProperty(name = MULTIPLE_CONFIG_PROPERTY_NAME, havingValue = "true")
+ @ConditionalOnProperty(prefix = DUBBO_CONFIG_PREFIX, name = MULTIPLE_CONFIG_PROPERTY_NAME, matchIfMissing = true)
@EnableDubboConfig(multiple = true)
protected static class MultipleDubboConfigConfiguration {
}
diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBindingAutoConfiguration.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBindingAutoConfiguration.java
new file mode 100644
index 0000000..4de242e
--- /dev/null
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBindingAutoConfiguration.java
@@ -0,0 +1,55 @@
+/*
+ * 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.spring.context.properties.DubboConfigBinder;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.bind.RelaxedPropertyResolver;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Scope;
+import org.springframework.core.env.Environment;
+import org.springframework.core.env.PropertyResolver;
+
+import static org.apache.dubbo.spring.boot.util.DubboUtils.BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME;
+import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_PREFIX;
+import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_SCAN_PREFIX;
+import static org.apache.dubbo.spring.boot.util.DubboUtils.RELAXED_DUBBO_CONFIG_BINDER_BEAN_NAME;
+import static org.springframework.beans.factory.config.ConfigurableBeanFactory.SCOPE_PROTOTYPE;
+
+/**
+ * Dubbo Relaxed Binding Auto-{@link Configuration} for Spring Boot 1.x
+ */
+@ConditionalOnProperty(prefix = DUBBO_PREFIX, name = "enabled", matchIfMissing = true)
+@ConditionalOnClass(name = "org.springframework.boot.bind.RelaxedPropertyResolver")
+@Configuration
+public class DubboRelaxedBindingAutoConfiguration {
+
+ @Bean(name = BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME)
+ public PropertyResolver dubboScanBasePackagesPropertyResolver(Environment environment) {
+ return new RelaxedPropertyResolver(environment, DUBBO_SCAN_PREFIX);
+ }
+
+ @ConditionalOnMissingBean(name = RELAXED_DUBBO_CONFIG_BINDER_BEAN_NAME, value = DubboConfigBinder.class)
+ @Bean(RELAXED_DUBBO_CONFIG_BINDER_BEAN_NAME)
+ @Scope(scopeName = SCOPE_PROTOTYPE)
+ public DubboConfigBinder relaxedDubboConfigBinder() {
+ return new RelaxedDubboConfigBinder();
+ }
+}
diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinder.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinder.java
new file mode 100644
index 0000000..b0e8480
--- /dev/null
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinder.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.autoconfigure;
+
+import org.apache.dubbo.config.AbstractConfig;
+import org.apache.dubbo.config.spring.context.properties.AbstractDubboConfigBinder;
+import org.apache.dubbo.config.spring.context.properties.DubboConfigBinder;
+import org.springframework.beans.MutablePropertyValues;
+import org.springframework.boot.bind.RelaxedDataBinder;
+
+import java.util.Map;
+
+import static org.apache.dubbo.config.spring.util.PropertySourcesUtils.getSubProperties;
+
+/**
+ * Spring Boot Relaxed {@link DubboConfigBinder} implementation
+ *
+ * @since 2.7.0
+ */
+class RelaxedDubboConfigBinder extends AbstractDubboConfigBinder {
+
+ @Override
+ public <C extends AbstractConfig> void bind(String prefix, C dubboConfig) {
+ RelaxedDataBinder relaxedDataBinder = new RelaxedDataBinder(dubboConfig);
+ // Set ignored*
+ relaxedDataBinder.setIgnoreInvalidFields(isIgnoreInvalidFields());
+ relaxedDataBinder.setIgnoreUnknownFields(isIgnoreUnknownFields());
+ // Get properties under specified prefix from PropertySources
+ Map<String, Object> properties = getSubProperties(getPropertySources(), prefix);
+ // Convert Map to MutablePropertyValues
+ MutablePropertyValues propertyValues = new MutablePropertyValues(properties);
+ // Bind
+ relaxedDataBinder.bind(propertyValues);
+ }
+}
diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/AwaitingNonWebApplicationListener.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/AwaitingNonWebApplicationListener.java
similarity index 80%
rename from dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/AwaitingNonWebApplicationListener.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/AwaitingNonWebApplicationListener.java
index f4a94d2..738c2b1 100644
--- a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/AwaitingNonWebApplicationListener.java
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/AwaitingNonWebApplicationListener.java
@@ -19,12 +19,13 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
-import org.springframework.boot.WebApplicationType;
import org.springframework.boot.context.event.ApplicationReadyEvent;
+import org.springframework.context.ApplicationContext;
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.ClassUtils;
import org.springframework.util.ObjectUtils;
import java.util.concurrent.ExecutorService;
@@ -37,10 +38,15 @@
/**
* Awaiting Non-Web Spring Boot {@link ApplicationListener}
*
- * @since 0.1.1
+ * @since 2.7.0
*/
public class AwaitingNonWebApplicationListener implements SmartApplicationListener {
+ private static final String[] WEB_APPLICATION_CONTEXT_CLASSES = new String[]{
+ "org.springframework.web.context.WebApplicationContext",
+ "org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext"
+ };
+
private static final Logger logger = LoggerFactory.getLogger(AwaitingNonWebApplicationListener.class);
private static final Class<? extends ApplicationEvent>[] SUPPORTED_APPLICATION_EVENTS =
@@ -90,12 +96,30 @@
final SpringApplication springApplication = event.getSpringApplication();
- if (!WebApplicationType.NONE.equals(springApplication.getWebApplicationType())) {
+ if (isWebApplication(event.getApplicationContext(), springApplication.getClassLoader())) {
return;
}
await();
+ }
+ private static boolean isWebApplication(ApplicationContext applicationContext, ClassLoader classLoader) {
+ boolean webApplication = false;
+ for (String contextClass : WEB_APPLICATION_CONTEXT_CLASSES) {
+ if (isAssignable(contextClass, applicationContext.getClass(), classLoader)) {
+ webApplication = true;
+ break;
+ }
+ }
+ return webApplication;
+ }
+
+ private static boolean isAssignable(String target, Class<?> type, ClassLoader classLoader) {
+ try {
+ return ClassUtils.resolveClassName(target, classLoader).isAssignableFrom(type);
+ } catch (Throwable ex) {
+ return false;
+ }
}
protected void onContextClosedEvent(ContextClosedEvent event) {
diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListener.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListener.java
similarity index 94%
rename from dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListener.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListener.java
index 319c1d9..6e6826b 100644
--- a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListener.java
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListener.java
@@ -18,7 +18,6 @@
import org.apache.dubbo.common.utils.ConfigUtils;
import org.apache.dubbo.config.AbstractConfig;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
@@ -30,7 +29,7 @@
import java.util.SortedMap;
import static org.apache.dubbo.spring.boot.util.DubboUtils.DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE;
-import static org.apache.dubbo.spring.boot.util.DubboUtils.OVERRIDE_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.filterDubboProperties;
/**
@@ -40,7 +39,7 @@
* <p>
*
* @see ConfigUtils
- * @since 1.0.0
+ * @since 2.7.0
*/
@Order // LOWEST_PRECEDENCE Make sure last execution
public class OverrideDubboConfigApplicationListener implements ApplicationListener<ApplicationEnvironmentPreparedEvent> {
@@ -56,7 +55,7 @@
ConfigurableEnvironment environment = event.getEnvironment();
- boolean override = environment.getProperty(OVERRIDE_CONFIG_PROPERTY_NAME, boolean.class,
+ boolean override = environment.getProperty(OVERRIDE_CONFIG_FULL_PROPERTY_NAME, boolean.class,
DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE);
if (override) {
@@ -66,19 +65,12 @@
ConfigUtils.getProperties().putAll(dubboProperties);
if (logger.isInfoEnabled()) {
-
logger.info("Dubbo Config was overridden by externalized configuration {}", dubboProperties);
-
}
-
} else {
-
if (logger.isInfoEnabled()) {
-
- logger.info("Disable override Dubbo Config caused by property {} = {}", OVERRIDE_CONFIG_PROPERTY_NAME, override);
-
+ logger.info("Disable override Dubbo Config caused by property {} = {}", OVERRIDE_CONFIG_FULL_PROPERTY_NAME, override);
}
-
}
}
diff --git a/dubbo-spring-boot-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
similarity index 95%
rename from dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListener.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListener.java
index 1db2438..f053227 100644
--- a/dubbo-spring-boot-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,12 +17,11 @@
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;
-import org.springframework.boot.context.logging.LoggingApplicationListener;
import org.springframework.context.ApplicationListener;
+import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -36,9 +35,9 @@
* Dubbo Welcome Logo {@link ApplicationListener}
*
* @see ApplicationListener
- * @since 1.0.0
+ * @since 2.7.0
*/
-@Order(LoggingApplicationListener.DEFAULT_ORDER + 1)
+@Order(Ordered.HIGHEST_PRECEDENCE + 20 + 1) // After LoggingApplicationListener#DEFAULT_ORDER
public class WelcomeLogoApplicationListener implements ApplicationListener<ApplicationEnvironmentPreparedEvent> {
private static AtomicBoolean processed = new AtomicBoolean(false);
diff --git a/dubbo-spring-boot-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
similarity index 99%
rename from dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessor.java
index 3e406c7..0efbc6b 100644
--- a/dubbo-spring-boot-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,7 +19,6 @@
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;
diff --git a/dubbo-spring-boot-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
similarity index 78%
rename from dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/DubboUtils.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/DubboUtils.java
index ba0e9c7..5b9fcd4 100644
--- a/dubbo-spring-boot-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,7 +16,10 @@
*/
package org.apache.dubbo.spring.boot.util;
+import org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor;
+import org.apache.dubbo.config.spring.context.properties.DubboConfigBinder;
import org.springframework.core.env.ConfigurableEnvironment;
+import org.springframework.core.env.PropertyResolver;
import java.util.Collections;
import java.util.Map;
@@ -26,7 +29,7 @@
/**
* The utilities class for Dubbo
*
- * @since 1.0.0
+ * @since 2.7.0
*/
public abstract class DubboUtils {
@@ -49,38 +52,38 @@
/**
* The prefix of property name for Dubbo scan
*/
- public static final String DUBBO_SCAN_PREFIX = DUBBO_PREFIX + PROPERTY_NAME_SEPARATOR + "scan";
+ public static final String DUBBO_SCAN_PREFIX = DUBBO_PREFIX + PROPERTY_NAME_SEPARATOR + "scan" + PROPERTY_NAME_SEPARATOR;
/**
- * The prefix of property name for Dubbo Config.ØØ
+ * The prefix of property name for Dubbo Config
*/
- public static final String DUBBO_CONFIG_PREFIX = DUBBO_PREFIX + PROPERTY_NAME_SEPARATOR + "config";
+ public static final String DUBBO_CONFIG_PREFIX = DUBBO_PREFIX + PROPERTY_NAME_SEPARATOR + "config" + PROPERTY_NAME_SEPARATOR;
/**
* The property name of base packages to scan
* <p>
* The default value is empty set.
*/
- public static final String BASE_PACKAGES_PROPERTY_NAME = DUBBO_SCAN_PREFIX + PROPERTY_NAME_SEPARATOR + "base-packages";
+ public static final String BASE_PACKAGES_PROPERTY_NAME = "base-packages";
/**
* The property name of multiple properties binding from externalized configuration
* <p>
* The default value is {@link #DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE}
*/
- public static final String MULTIPLE_CONFIG_PROPERTY_NAME = DUBBO_CONFIG_PREFIX + PROPERTY_NAME_SEPARATOR + "multiple";
+ public static final String MULTIPLE_CONFIG_PROPERTY_NAME = "multiple";
/**
* The default value of multiple properties binding from externalized configuration
*/
- public static final boolean DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE = false;
+ public static final boolean DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE = true;
/**
* The property name of override Dubbo config
* <p>
* The default value is {@link #DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE}
*/
- public static final String OVERRIDE_CONFIG_PROPERTY_NAME = DUBBO_CONFIG_PREFIX + PROPERTY_NAME_SEPARATOR + "override";
+ public static final String OVERRIDE_CONFIG_FULL_PROPERTY_NAME = DUBBO_CONFIG_PREFIX + "override";
/**
* The default property value of override Dubbo config
@@ -114,6 +117,16 @@
public static final String DUBBO_MAILING_LIST = "dev@dubbo.apache.org";
/**
+ * The bean name of Relaxed-binding {@link DubboConfigBinder}
+ */
+ public static final String RELAXED_DUBBO_CONFIG_BINDER_BEAN_NAME = "relaxedDubboConfigBinder";
+
+ /**
+ * The bean name of {@link PropertyResolver} for {@link ServiceAnnotationBeanPostProcessor}'s base-packages
+ */
+ public static final String BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME = "dubboScanBasePackagesPropertyResolver";
+
+ /**
* Filters Dubbo Properties from {@link ConfigurableEnvironment}
*
* @param environment {@link ConfigurableEnvironment}
diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/EnvironmentUtils.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/EnvironmentUtils.java
similarity index 99%
rename from dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/EnvironmentUtils.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/EnvironmentUtils.java
index 1f0e118..943c1a4 100644
--- a/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/EnvironmentUtils.java
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/util/EnvironmentUtils.java
@@ -32,7 +32,7 @@
* The utilities class for {@link Environment}
*
* @see Environment
- * @since 1.0.0
+ * @since 2.7.0
*/
public abstract class EnvironmentUtils {
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
new file mode 100644
index 0000000..d810121
--- /dev/null
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json
@@ -0,0 +1,1098 @@
+{
+ "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<java.lang.String,java.lang.String>"
+ },
+ {
+ "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<org.apache.dubbo.config.RegistryConfig>"
+ },
+ {
+ "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<java.lang.String,org.apache.dubbo.config.ApplicationConfig>"
+ },
+ {
+ "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<java.lang.String,java.lang.String>"
+ },
+ {
+ "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<org.apache.dubbo.config.RegistryConfig>"
+ },
+ {
+ "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<java.lang.String,org.apache.dubbo.config.ConsumerConfig>"
+ },
+ {
+ "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<org.apache.dubbo.config.RegistryConfig>"
+ },
+ {
+ "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<java.lang.String,org.apache.dubbo.config.ModuleConfig>"
+ },
+ {
+ "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<java.lang.String,java.lang.String>"
+ },
+ {
+ "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<java.lang.String,org.apache.dubbo.config.MonitorConfig>"
+ },
+ {
+ "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<java.lang.String,java.lang.String>"
+ },
+ {
+ "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<java.lang.String,org.apache.dubbo.config.ProtocolConfig>"
+ },
+ {
+ "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<java.lang.String,java.lang.String>"
+ },
+ {
+ "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<org.apache.dubbo.config.ProtocolConfig>"
+ },
+ {
+ "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<org.apache.dubbo.config.RegistryConfig>"
+ },
+ {
+ "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<java.lang.String,org.apache.dubbo.config.ProviderConfig>"
+ },
+ {
+ "sourceType": "org.apache.dubbo.spring.boot.autoconfigure.MultipleDubboConfigBindingProperties",
+ "name": "dubbo.registries",
+ "description": "Multiple {@link RegistryConfig} property",
+ "type": "java.util.Map<java.lang.String,org.apache.dubbo.config.RegistryConfig>"
+ },
+ {
+ "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<java.lang.String,java.lang.String>"
+ },
+ {
+ "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<java.lang.String>"
+ }
+ ]
+}
\ 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
new file mode 100644
index 0000000..08db894
--- /dev/null
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories
@@ -0,0 +1,9 @@
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration,\
+org.apache.dubbo.spring.boot.autoconfigure.DubboRelaxedBindingAutoConfiguration
+org.springframework.context.ApplicationListener=\
+org.apache.dubbo.spring.boot.context.event.OverrideDubboConfigApplicationListener,\
+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
diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/CompatibleDubboAutoConfigurationTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/CompatibleDubboAutoConfigurationTest.java
new file mode 100644
index 0000000..cd574e0
--- /dev/null
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/CompatibleDubboAutoConfigurationTest.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 org.apache.dubbo.spring.boot.autoconfigure;
+
+import org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor;
+import org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.ObjectProvider;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * {@link DubboAutoConfiguration} Test
+ *
+ * @see DubboAutoConfiguration
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = {
+ CompatibleDubboAutoConfigurationTest.class
+}, properties = {
+ "dubbo.scan.base-packages = org.apache.dubbo.spring.boot.autoconfigure"
+})
+@EnableAutoConfiguration
+public class CompatibleDubboAutoConfigurationTest {
+
+ @Autowired
+ private ObjectProvider<ServiceAnnotationBeanPostProcessor> serviceAnnotationBeanPostProcessor;
+
+ @Autowired
+ private ObjectProvider<ReferenceAnnotationBeanPostProcessor> referenceAnnotationBeanPostProcessor;
+
+ @Test
+ public void testBeans() {
+ Assert.assertNotNull(serviceAnnotationBeanPostProcessor);
+ Assert.assertNotNull(serviceAnnotationBeanPostProcessor.getIfAvailable());
+ Assert.assertNotNull(referenceAnnotationBeanPostProcessor);
+ Assert.assertNotNull(referenceAnnotationBeanPostProcessor.getIfAvailable());
+ }
+}
diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/CompatibleDubboAutoConfigurationTestWithoutProperties.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/CompatibleDubboAutoConfigurationTestWithoutProperties.java
new file mode 100644
index 0000000..06a21d8
--- /dev/null
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/CompatibleDubboAutoConfigurationTestWithoutProperties.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 org.apache.dubbo.spring.boot.autoconfigure;
+
+import org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor;
+import org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * {@link DubboAutoConfiguration} Test
+ *
+ * @see DubboAutoConfiguration
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = CompatibleDubboAutoConfigurationTestWithoutProperties.class)
+@EnableAutoConfiguration
+public class CompatibleDubboAutoConfigurationTestWithoutProperties {
+
+ @Autowired(required = false)
+ private ServiceAnnotationBeanPostProcessor serviceAnnotationBeanPostProcessor;
+
+ @Autowired
+ private ReferenceAnnotationBeanPostProcessor referenceAnnotationBeanPostProcessor;
+
+ @Test
+ public void testBeans() {
+ Assert.assertNull(serviceAnnotationBeanPostProcessor);
+ Assert.assertNotNull(referenceAnnotationBeanPostProcessor);
+ }
+}
diff --git a/dubbo-spring-boot-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
similarity index 96%
rename from dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnMultipleConfigTest.java
index 5a6d737..1addb5e 100644
--- a/dubbo-spring-boot-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,17 +23,17 @@
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit4.SpringRunner;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -43,9 +43,9 @@
/**
* {@link DubboAutoConfiguration} Test On multiple Dubbo Configuration
*
- * @since 1.0.0
+ * @since 2.7.0
*/
-@RunWith(SpringJUnit4ClassRunner.class)
+@RunWith(SpringRunner.class)
@TestPropertySource(
properties = {
"dubbo.applications.application1.NAME = dubbo-demo-application",
@@ -62,8 +62,11 @@
}
)
@SpringBootTest(
- classes = {DubboAutoConfiguration.class}
+ classes = {
+ DubboAutoConfigurationOnMultipleConfigTest.class
+ }
)
+@EnableAutoConfiguration
public class DubboAutoConfigurationOnMultipleConfigTest {
@Autowired
diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnSingleConfigTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnSingleConfigTest.java
similarity index 87%
rename from dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnSingleConfigTest.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnSingleConfigTest.java
index 6f93ad0..28d1e6d 100644
--- a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnSingleConfigTest.java
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfigurationOnSingleConfigTest.java
@@ -23,25 +23,23 @@
import org.apache.dubbo.config.ProtocolConfig;
import org.apache.dubbo.config.ProviderConfig;
import org.apache.dubbo.config.RegistryConfig;
-import org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor;
-import org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor;
-
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit4.SpringRunner;
/**
* {@link DubboAutoConfiguration} Test On single Dubbo Configuration
*
- * @since 1.0.0
+ * @since 2.7.0
*/
-@RunWith(SpringJUnit4ClassRunner.class)
+@RunWith(SpringRunner.class)
@TestPropertySource(
properties = {
"dubbo.application.name = dubbo-demo-application",
@@ -55,8 +53,9 @@
}
)
@SpringBootTest(
- classes = {DubboAutoConfiguration.class}
+ classes = {DubboAutoConfigurationOnSingleConfigTest.class}
)
+@EnableAutoConfiguration
public class DubboAutoConfigurationOnSingleConfigTest {
@Autowired
@@ -92,12 +91,6 @@
@Autowired
private ApplicationContext applicationContext;
- @Autowired(required = false)
- private ServiceAnnotationBeanPostProcessor serviceAnnotationBeanPostProcessor;
-
- @Autowired
- private ReferenceAnnotationBeanPostProcessor referenceAnnotationBeanPostProcessor;
-
@Test
public void testApplicationConfig() {
diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinderTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinderTest.java
similarity index 85%
copy from dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinderTest.java
copy to dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinderTest.java
index fa91c09..817f035 100644
--- a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinderTest.java
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/RelaxedDubboConfigBinderTest.java
@@ -19,7 +19,7 @@
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ProtocolConfig;
import org.apache.dubbo.config.RegistryConfig;
-
+import org.apache.dubbo.config.spring.context.properties.DubboConfigBinder;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,16 +30,20 @@
/**
* {@link RelaxedDubboConfigBinder} Test
- *
- * @since 0.1.1
*/
@RunWith(SpringRunner.class)
-@TestPropertySource(locations = "classpath:/dubbo.properties")
+@TestPropertySource(properties = {
+ "dubbo.application.NAME=hello",
+ "dubbo.application.owneR=world",
+ "dubbo.registry.Address=10.20.153.17",
+ "dubbo.protocol.pORt=20881",
+ "dubbo.service.invoke.timeout=2000",
+})
@ContextConfiguration(classes = RelaxedDubboConfigBinder.class)
public class RelaxedDubboConfigBinderTest {
@Autowired
- private RelaxedDubboConfigBinder dubboConfigBinder;
+ private DubboConfigBinder dubboConfigBinder;
@Test
public void testBinder() {
diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/AwaitingNonWebApplicationListenerTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/AwaitingNonWebApplicationListenerTest.java
new file mode 100644
index 0000000..8de2cae
--- /dev/null
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/AwaitingNonWebApplicationListenerTest.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.dubbo.spring.boot.context.event;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * {@link AwaitingNonWebApplicationListener} Test
+ */
+public class AwaitingNonWebApplicationListenerTest {
+
+ @Test
+ public void init() {
+ AtomicBoolean awaited = AwaitingNonWebApplicationListener.getAwaited();
+ awaited.set(false);
+
+ }
+
+ @Test
+ public void testSingleContextNonWebApplication() {
+ new SpringApplicationBuilder(Object.class)
+ .web(false)
+ .run().close();
+ AtomicBoolean awaited = AwaitingNonWebApplicationListener.getAwaited();
+ Assert.assertTrue(awaited.get());
+ }
+
+ @Test
+ public void testMultipleContextNonWebApplication() {
+ new SpringApplicationBuilder(Object.class)
+ .parent(Object.class)
+ .web(false)
+ .run().close();
+ AtomicBoolean awaited = AwaitingNonWebApplicationListener.getAwaited();
+ Assert.assertTrue(awaited.get());
+ }
+
+}
diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerDisableTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerDisableTest.java
similarity index 93%
rename from dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerDisableTest.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerDisableTest.java
index 3fff621..4bea84c 100644
--- a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerDisableTest.java
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerDisableTest.java
@@ -17,14 +17,13 @@
package org.apache.dubbo.spring.boot.context.event;
import org.apache.dubbo.common.utils.ConfigUtils;
-
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit4.SpringRunner;
import java.util.Properties;
@@ -32,9 +31,9 @@
* {@link OverrideDubboConfigApplicationListener} Test
*
* @see OverrideDubboConfigApplicationListener
- * @since 1.0.0
+ * @since 2.7.0
*/
-@RunWith(SpringJUnit4ClassRunner.class)
+@RunWith(SpringRunner.class)
@TestPropertySource(
properties = {
"dubbo.config.override = false",
diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerTest.java
similarity index 94%
rename from dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerTest.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerTest.java
index 8e81161..5e42561 100644
--- a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerTest.java
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerTest.java
@@ -17,14 +17,13 @@
package org.apache.dubbo.spring.boot.context.event;
import org.apache.dubbo.common.utils.ConfigUtils;
-
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit4.SpringRunner;
import java.util.Properties;
@@ -32,9 +31,9 @@
* {@link OverrideDubboConfigApplicationListener} Test
*
* @see OverrideDubboConfigApplicationListener
- * @since 1.0.0
+ * @since 2.7.0
*/
-@RunWith(SpringJUnit4ClassRunner.class)
+@RunWith(SpringRunner.class)
@TestPropertySource(
properties = {
"dubbo.application.name = dubbo-demo-application",
diff --git a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListenerTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListenerTest.java
similarity index 92%
rename from dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListenerTest.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListenerTest.java
index be9d2a3..c006a75 100644
--- a/dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListenerTest.java
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/WelcomeLogoApplicationListenerTest.java
@@ -21,15 +21,15 @@
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit4.SpringRunner;
/**
* {@link WelcomeLogoApplicationListener} Test
*
* @see WelcomeLogoApplicationListener
- * @since 1.0.0
+ * @since 2.7.0
*/
-@RunWith(SpringJUnit4ClassRunner.class)
+@RunWith(SpringRunner.class)
@SpringBootTest(
classes = {WelcomeLogoApplicationListener.class}
)
diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessorTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessorTest.java
new file mode 100644
index 0000000..2fbb6aa
--- /dev/null
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/env/DubboDefaultPropertiesEnvironmentPostProcessorTest.java
@@ -0,0 +1,97 @@
+/*
+ * 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.env;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.boot.SpringApplication;
+import org.springframework.core.Ordered;
+import org.springframework.core.env.MapPropertySource;
+import org.springframework.core.env.MutablePropertySources;
+import org.springframework.core.env.PropertySource;
+import org.springframework.mock.env.MockEnvironment;
+
+import java.util.HashMap;
+
+/**
+ * {@link DubboDefaultPropertiesEnvironmentPostProcessor} Test
+ */
+public class DubboDefaultPropertiesEnvironmentPostProcessorTest {
+
+ private DubboDefaultPropertiesEnvironmentPostProcessor instance =
+ new DubboDefaultPropertiesEnvironmentPostProcessor();
+
+ private SpringApplication springApplication = new SpringApplication();
+
+ @Test
+ public void testOrder() {
+ Assert.assertEquals(Ordered.LOWEST_PRECEDENCE, instance.getOrder());
+ }
+
+ @Test
+ public void testPostProcessEnvironment() {
+ MockEnvironment environment = new MockEnvironment();
+ // Case 1 : Not Any property
+ instance.postProcessEnvironment(environment, springApplication);
+ // Get PropertySources
+ MutablePropertySources propertySources = environment.getPropertySources();
+ // Nothing to change
+ PropertySource defaultPropertySource = propertySources.get("defaultProperties");
+ Assert.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");
+ instance.postProcessEnvironment(environment, springApplication);
+ defaultPropertySource = propertySources.get("defaultProperties");
+ Object dubboApplicationName = defaultPropertySource.getProperty("dubbo.application.name");
+ Assert.assertEquals("demo-dubbo-application", dubboApplicationName);
+
+ // Case 3 : Only set property "dubbo.application.name"
+ // Rest environment
+ environment = new MockEnvironment();
+ propertySources = environment.getPropertySources();
+ environment.setProperty("dubbo.application.name", "demo-dubbo-application");
+ instance.postProcessEnvironment(environment, springApplication);
+ defaultPropertySource = propertySources.get("defaultProperties");
+ Assert.assertNotNull(defaultPropertySource);
+ dubboApplicationName = environment.getProperty("dubbo.application.name");
+ Assert.assertEquals("demo-dubbo-application", dubboApplicationName);
+
+ // Case 4 : If "defaultProperties" PropertySource is present in PropertySources
+ // Rest environment
+ environment = new MockEnvironment();
+ propertySources = environment.getPropertySources();
+ propertySources.addLast(new MapPropertySource("defaultProperties", new HashMap<String, Object>()));
+ environment.setProperty("spring.application.name", "demo-dubbo-application");
+ instance.postProcessEnvironment(environment, springApplication);
+ defaultPropertySource = propertySources.get("defaultProperties");
+ dubboApplicationName = defaultPropertySource.getProperty("dubbo.application.name");
+ Assert.assertEquals("demo-dubbo-application", dubboApplicationName);
+
+ // Case 5 : Rest dubbo.config.multiple and dubbo.application.qos-enable
+ environment = new MockEnvironment();
+ propertySources = environment.getPropertySources();
+ propertySources.addLast(new MapPropertySource("defaultProperties", new HashMap<String, Object>()));
+ 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-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
similarity index 82%
rename from dubbo-spring-boot-autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/DubboUtilsTest.java
rename to dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/DubboUtilsTest.java
index 910cb7c..7242b58 100644
--- a/dubbo-spring-boot-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
@@ -34,14 +34,14 @@
import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_SPRING_BOOT_GIT_URL;
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_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.filterDubboProperties;
/**
* {@link DubboUtils} Test
*
* @see DubboUtils
- * @since 1.0.0
+ * @since 2.7.0
*/
public class DubboUtilsTest {
@@ -50,15 +50,15 @@
Assert.assertEquals("dubbo", DUBBO_PREFIX);
- Assert.assertEquals("dubbo.scan", DUBBO_SCAN_PREFIX);
+ Assert.assertEquals("dubbo.scan.", DUBBO_SCAN_PREFIX);
- Assert.assertEquals("dubbo.scan.base-packages", BASE_PACKAGES_PROPERTY_NAME);
+ Assert.assertEquals("base-packages", BASE_PACKAGES_PROPERTY_NAME);
- Assert.assertEquals("dubbo.config", DUBBO_CONFIG_PREFIX);
+ Assert.assertEquals("dubbo.config.", DUBBO_CONFIG_PREFIX);
- Assert.assertEquals("dubbo.config.multiple", MULTIPLE_CONFIG_PROPERTY_NAME);
+ Assert.assertEquals("multiple", MULTIPLE_CONFIG_PROPERTY_NAME);
- Assert.assertEquals("dubbo.config.override", OVERRIDE_CONFIG_PROPERTY_NAME);
+ Assert.assertEquals("dubbo.config.override", OVERRIDE_CONFIG_FULL_PROPERTY_NAME);
Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project", DUBBO_SPRING_BOOT_GITHUB_URL);
Assert.assertEquals("https://github.com/apache/incubator-dubbo-spring-boot-project.git", DUBBO_SPRING_BOOT_GIT_URL);
@@ -68,7 +68,7 @@
Assert.assertEquals("dev@dubbo.apache.org", DUBBO_MAILING_LIST);
- Assert.assertFalse(DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE);
+ Assert.assertTrue(DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE);
Assert.assertTrue(DEFAULT_OVERRIDE_CONFIG_PROPERTY_VALUE);
@@ -80,13 +80,13 @@
MockEnvironment environment = new MockEnvironment();
environment.setProperty("message", "Hello,World");
- environment.setProperty(MULTIPLE_CONFIG_PROPERTY_NAME, "true");
- environment.setProperty(OVERRIDE_CONFIG_PROPERTY_NAME, "true");
+ environment.setProperty(DUBBO_CONFIG_PREFIX + MULTIPLE_CONFIG_PROPERTY_NAME, "true");
+ environment.setProperty(OVERRIDE_CONFIG_FULL_PROPERTY_NAME, "true");
SortedMap<String, Object> dubboProperties = filterDubboProperties(environment);
- Assert.assertEquals("true", dubboProperties.get(MULTIPLE_CONFIG_PROPERTY_NAME));
- Assert.assertEquals("true", dubboProperties.get(OVERRIDE_CONFIG_PROPERTY_NAME));
+ Assert.assertEquals("true", dubboProperties.get(DUBBO_CONFIG_PREFIX + MULTIPLE_CONFIG_PROPERTY_NAME));
+ Assert.assertEquals("true", dubboProperties.get(OVERRIDE_CONFIG_FULL_PROPERTY_NAME));
}
diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/EnvironmentUtilsTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/EnvironmentUtilsTest.java
new file mode 100644
index 0000000..2ca3766
--- /dev/null
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/util/EnvironmentUtilsTest.java
@@ -0,0 +1,63 @@
+/*
+ * 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.util;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.core.env.CompositePropertySource;
+import org.springframework.core.env.MapPropertySource;
+import org.springframework.core.env.MutablePropertySources;
+import org.springframework.core.env.StandardEnvironment;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * {@link EnvironmentUtils} Test
+ *
+ * @see EnvironmentUtils
+ * @since 2.7.0
+ */
+public class EnvironmentUtilsTest {
+
+ @Test
+ public void testExtraProperties() {
+
+ System.setProperty("user.name", "mercyblitz");
+
+ StandardEnvironment environment = new StandardEnvironment();
+
+ Map<String, Object> map = new HashMap<>();
+
+ map.put("user.name", "Mercy");
+
+ MapPropertySource propertySource = new MapPropertySource("first", map);
+
+ CompositePropertySource compositePropertySource = new CompositePropertySource("comp");
+
+ compositePropertySource.addFirstPropertySource(propertySource);
+
+ MutablePropertySources propertySources = environment.getPropertySources();
+
+ propertySources.addFirst(compositePropertySource);
+
+ Map<String, Object> properties = EnvironmentUtils.extractProperties(environment);
+
+ Assert.assertEquals("Mercy", properties.get("user.name"));
+
+ }
+}
diff --git a/dubbo-spring-boot-compatible/pom.xml b/dubbo-spring-boot-compatible/pom.xml
new file mode 100644
index 0000000..8af787e
--- /dev/null
+++ b/dubbo-spring-boot-compatible/pom.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ 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">
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-parent</artifactId>
+ <version>${revision}</version>
+ <relativePath>../dubbo-spring-boot-parent/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>dubbo-spring-boot-compatible</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Dubbo Spring Boot :: Compatible</name>
+ <description>Apache Dubbo Spring Boot Compatible for Spring Boot 1.x</description>
+
+ <properties>
+ <spring-boot.version>1.5.19.RELEASE</spring-boot.version>
+ </properties>
+
+ <modules>
+ <module>autoconfigure</module>
+ <module>actuator</module>
+ </modules>
+
+</project>
\ No newline at end of file
diff --git a/dubbo-spring-boot-distribution/pom.xml b/dubbo-spring-boot-distribution/pom.xml
index 38f4a19..181ba44 100644
--- a/dubbo-spring-boot-distribution/pom.xml
+++ b/dubbo-spring-boot-distribution/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -13,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.
--->
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
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">
@@ -27,7 +28,7 @@
<artifactId>dubbo-spring-boot-distribution</artifactId>
<packaging>pom</packaging>
- <name>Apache Dubbo Spring Boot Distribution</name>
+ <name>Apache Dubbo Spring Boot :: Distribution</name>
<description>Apache Dubbo Spring Boot Distribution</description>
diff --git a/dubbo-spring-boot-parent/pom.xml b/dubbo-spring-boot-parent/pom.xml
index e1db10f..9d7b1e8 100644
--- a/dubbo-spring-boot-parent/pom.xml
+++ b/dubbo-spring-boot-parent/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -28,7 +29,7 @@
<artifactId>dubbo-spring-boot-parent</artifactId>
<packaging>pom</packaging>
- <name>Apache Dubbo Spring Boot Parent</name>
+ <name>Apache Dubbo Spring Boot :: Parent</name>
<description>Apache Dubbo Spring Boot Parent</description>
<properties>
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 304dddb..4f01fe1 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
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -26,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-spring-boot-auto-configure-consumer-sample</artifactId>
- <name>Apache Dubbo Spring Boot Samples : Auto-Configure :: Consumer Sample</name>
+ <name>Apache Dubbo Spring Boot :: Samples : Auto-Configure :: Consumer Sample</name>
<dependencies>
<!-- Spring Boot dependencies -->
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 a76da3d..5b2ac82 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
@@ -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;
@@ -29,7 +28,7 @@
/**
* Dubbo Auto Configuration Consumer Bootstrap
*
- * @since 1.0.0
+ * @since 2.7.0
*/
@EnableAutoConfiguration
public class DubboAutoConfigurationConsumerBootstrap {
diff --git a/dubbo-spring-boot-samples/auto-configure-samples/pom.xml b/dubbo-spring-boot-samples/auto-configure-samples/pom.xml
index 51d8661..3df5bf5 100644
--- a/dubbo-spring-boot-samples/auto-configure-samples/pom.xml
+++ b/dubbo-spring-boot-samples/auto-configure-samples/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -26,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-spring-boot-auto-configure-samples</artifactId>
- <name>Apache Dubbo Spring Boot Samples : Auto-Configure</name>
+ <name>Apache Dubbo Spring Boot :: Samples : Auto-Configure</name>
<description>Apache Dubbo Spring Boot Auto-Configure Samples</description>
<packaging>pom</packaging>
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 048ccb0..a7aca3a 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
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -26,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-spring-boot-auto-configure-provider-sample</artifactId>
- <name>Apache Dubbo Spring Boot Samples : Auto-Configure :: Provider Sample</name>
+ <name>Apache Dubbo Spring Boot :: Samples : Auto-Configure :: Provider Sample</name>
<dependencies>
diff --git a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboAutoConfigurationProviderBootstrap.java b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboAutoConfigurationProviderBootstrap.java
index 949f5ce..bd61706 100644
--- a/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboAutoConfigurationProviderBootstrap.java
+++ b/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboAutoConfigurationProviderBootstrap.java
@@ -17,8 +17,6 @@
package org.apache.dubbo.spring.boot.demo.provider.bootstrap;
import org.apache.dubbo.spring.boot.demo.provider.service.DefaultDemoService;
-
-import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
@@ -26,14 +24,13 @@
* Dubbo Auto-Configuration Provider Bootstrap
*
* @see DefaultDemoService
- * @since 1.0.0
+ * @since 2.7.0
*/
@EnableAutoConfiguration
public class DubboAutoConfigurationProviderBootstrap {
public static void main(String[] args) {
new SpringApplicationBuilder(DubboAutoConfigurationProviderBootstrap.class)
- .web(WebApplicationType.NONE)
.run(args);
}
}
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 257bee6..61195ac 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
@@ -18,14 +18,13 @@
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 1.0.0
+ * @since 2.7.0
*/
@Service(version = "1.0.0")
public class DefaultDemoService implements DemoService {
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 c80eaf8..1941193 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
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -26,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-spring-boot-registry-zookeeper-consumer-sample</artifactId>
- <name>Apache Dubbo Spring Boot Samples : Registry Zookeeper :: Consumer Sample</name>
+ <name>Apache Dubbo Spring Boot :: Samples : Registry Zookeeper :: Consumer Sample</name>
<dependencies>
<!-- Spring Boot dependencies -->
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 b0b46fe..741dce9 100644
--- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/pom.xml
+++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -26,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-spring-boot-registry-zookeeper-samples</artifactId>
- <name>Apache Dubbo Spring Boot Samples : Registry Zookeeper</name>
+ <name>Apache Dubbo Spring Boot :: Samples : Registry Zookeeper</name>
<description>Apache Dubbo Spring Boot Registry Zookeeper Samples</description>
<packaging>pom</packaging>
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 810def9..c41c446 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
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -26,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-spring-boot-registry-zookeeper-provider-sample</artifactId>
- <name>Apache Dubbo Spring Boot Samples : Registry Zookeeper :: Provider Sample</name>
+ <name>Apache Dubbo Spring Boot :: Samples : Registry Zookeeper :: Provider Sample</name>
<dependencies>
diff --git a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboRegistryZooKeeperProviderBootstrap.java b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboRegistryZooKeeperProviderBootstrap.java
index a2f1eaa..5f20c85 100644
--- a/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboRegistryZooKeeperProviderBootstrap.java
+++ b/dubbo-spring-boot-samples/dubbo-registry-zookeeper-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboRegistryZooKeeperProviderBootstrap.java
@@ -17,8 +17,6 @@
package org.apache.dubbo.spring.boot.demo.provider.bootstrap;
import org.apache.dubbo.spring.boot.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;
@@ -29,14 +27,13 @@
* Dubbo Registry ZooKeeper Provider Bootstrap
*
* @see DefaultDemoService
- * @since 1.0.0
+ * @since 2.7.0
*/
@EnableAutoConfiguration
public class DubboRegistryZooKeeperProviderBootstrap {
public static void main(String[] args) {
new SpringApplicationBuilder(DubboRegistryZooKeeperProviderBootstrap.class)
- .web(WebApplicationType.NONE)
.listeners((ApplicationListener<ApplicationEnvironmentPreparedEvent>) event -> {
Environment environment = event.getEnvironment();
int port = environment.getProperty("embedded.zookeeper.port", int.class);
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 1e4c18b..6ff5f7a 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
@@ -18,14 +18,13 @@
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 1.0.0
+ * @since 2.7.0
*/
@Service(version = "${demo.service.version}")
public class DefaultDemoService implements DemoService {
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 6804c6b..893dd4b 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
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -26,18 +27,30 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-spring-boot-externalized-configuration-consumer-sample</artifactId>
- <name>Apache Dubbo Spring Boot Samples : Externalized Configuration :: Consumer Sample</name>
+ <name>Apache Dubbo Spring Boot :: Samples : Externalized Configuration :: Consumer Sample</name>
<dependencies>
<!-- Spring Boot dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-actuator</artifactId>
+ </dependency>
+
+ <!-- Dubbo Spring Boot dependencies -->
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ <version>${revision}</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-spring-boot-starter</artifactId>
+ <artifactId>dubbo-spring-boot-actuator</artifactId>
<version>${revision}</version>
</dependency>
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 835bfac..f36ec2b 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
@@ -18,18 +18,21 @@
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;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
/**
* Dubbo Externalized Configuration Consumer Bootstrap
*/
@EnableAutoConfiguration
+@RestController
public class DubboExternalizedConfigurationConsumerBootstrap {
private final Logger logger = LoggerFactory.getLogger(getClass());
@@ -38,7 +41,12 @@
private DemoService demoService;
public static void main(String[] args) {
- SpringApplication.run(DubboExternalizedConfigurationConsumerBootstrap.class).close();
+ SpringApplication.run(DubboExternalizedConfigurationConsumerBootstrap.class);
+ }
+
+ @GetMapping("/say-hello")
+ public String sayHello(@RequestParam String name) {
+ return demoService.sayHello(name);
}
@Bean
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
index e3aef42..3f98bc1 100644
--- 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
@@ -2,6 +2,44 @@
application:
name: dubbo-externalized-configuration-consumer-sample
+management:
+ endpoints:
+ web:
+ exposure:
+ include: '*'
+ endpoint:
+ dubbo:
+ enabled: true
+ dubboshutdown:
+ enabled: true
+ dubboconfigs:
+ enabled: true
+ dubboservices:
+ enabled: true
+ dubboreferences:
+ enabled: true
+ dubboproperties:
+ enabled: true
+ security:
+ ## Deprecated 2.x
+ enabled: false
+
+## For Spring Boot 1.x demo
+endpoints:
+ dubbo:
+ enabled: true
+ sensitive: false
+ dubboshutdown:
+ enabled: true
+ dubboconfigs:
+ enabled: true
+ dubboservices:
+ enabled: true
+ dubboreferences:
+ enabled: true
+ dubboproperties:
+ enabled: true
+
demo:
service:
version: 1.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 75a4810..86e26ad 100644
--- a/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml
+++ b/dubbo-spring-boot-samples/externalized-configuration-samples/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -26,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-spring-boot-externalized-configuration-samples</artifactId>
- <name>Apache Dubbo Spring Boot Samples : Externalized Configuration</name>
+ <name>Apache Dubbo Spring Boot :: Samples : Externalized Configuration</name>
<description>Apache Dubbo Spring Boot Externalized Configuration Samples</description>
<packaging>pom</packaging>
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 c9c9e01..47a2bb1 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
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -26,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-spring-boot-externalized-configuration-provider-sample</artifactId>
- <name>Apache Dubbo Spring Boot Samples : Externalized Configuration :: Provider Sample</name>
+ <name>Apache Dubbo Spring Boot :: Samples : Externalized Configuration :: Provider Sample</name>
<dependencies>
diff --git a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboExternalizedConfigurationProviderBootstrap.java b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboExternalizedConfigurationProviderBootstrap.java
index 657dddd..2671f75 100644
--- a/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboExternalizedConfigurationProviderBootstrap.java
+++ b/dubbo-spring-boot-samples/externalized-configuration-samples/provider-sample/src/main/java/org/apache/dubbo/spring/boot/demo/provider/bootstrap/DubboExternalizedConfigurationProviderBootstrap.java
@@ -17,8 +17,6 @@
package org.apache.dubbo.spring.boot.demo.provider.bootstrap;
import org.apache.dubbo.spring.boot.demo.provider.service.DefaultDemoService;
-
-import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
@@ -26,14 +24,13 @@
* Dubbo Externalized Configuration Provider Bootstrap
*
* @see DefaultDemoService
- * @since 1.0.0
+ * @since 2.7.0
*/
@EnableAutoConfiguration
public class DubboExternalizedConfigurationProviderBootstrap {
public static void main(String[] args) {
new SpringApplicationBuilder(DubboExternalizedConfigurationProviderBootstrap.class)
- .web(WebApplicationType.NONE)
.run(args);
}
}
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 1e4c18b..6ff5f7a 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
@@ -18,14 +18,13 @@
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 1.0.0
+ * @since 2.7.0
*/
@Service(version = "${demo.service.version}")
public class DefaultDemoService implements DemoService {
diff --git a/dubbo-spring-boot-samples/pom.xml b/dubbo-spring-boot-samples/pom.xml
index 33d018f..450f328 100644
--- a/dubbo-spring-boot-samples/pom.xml
+++ b/dubbo-spring-boot-samples/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -28,8 +29,8 @@
<groupId>org.apache.dubbo.samples</groupId>
<artifactId>dubbo-spring-boot-samples</artifactId>
<packaging>pom</packaging>
- <name>Apache Dubbo Spring Boot Samples</name>
- <description>Apache Dubbo Spring Boot Samples</description>
+ <name>Apache Dubbo Spring Boot :: Samples</name>
+ <description>Apache Dubbo Spring Boot :: Samples</description>
<modules>
<module>sample-api</module>
diff --git a/dubbo-spring-boot-samples/sample-api/pom.xml b/dubbo-spring-boot-samples/sample-api/pom.xml
index bf3cfd1..25964a5 100644
--- a/dubbo-spring-boot-samples/sample-api/pom.xml
+++ b/dubbo-spring-boot-samples/sample-api/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -26,6 +27,6 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-spring-boot-sample-api</artifactId>
- <name>Apache Dubbo Spring Boot Samples : API</name>
+ <name>Apache Dubbo Spring Boot :: Samples : API</name>
</project>
\ No newline at end of file
diff --git a/dubbo-spring-boot-samples/sample-api/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/DemoService.java b/dubbo-spring-boot-samples/sample-api/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/DemoService.java
index 0ec07f2..905e94e 100644
--- a/dubbo-spring-boot-samples/sample-api/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/DemoService.java
+++ b/dubbo-spring-boot-samples/sample-api/src/main/java/org/apache/dubbo/spring/boot/demo/consumer/DemoService.java
@@ -19,7 +19,7 @@
/**
* Demo Service interface
*
- * @since 1.0.0
+ * @since 2.7.0
*/
public interface DemoService {
diff --git a/dubbo-spring-boot-starter/pom.xml b/dubbo-spring-boot-starter/pom.xml
index ac2576d..d71a846 100644
--- a/dubbo-spring-boot-starter/pom.xml
+++ b/dubbo-spring-boot-starter/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -27,7 +28,7 @@
<artifactId>dubbo-spring-boot-starter</artifactId>
<packaging>jar</packaging>
- <name>Apache Dubbo Spring Boot Starter</name>
+ <name>Apache Dubbo Spring Boot :: Starter</name>
<description>Apache Dubbo Spring Boot Starter</description>
@@ -39,19 +40,6 @@
<optional>true</optional>
</dependency>
- <!-- ZK -->
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- <optional>true</optional>
- </dependency>
-
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-framework</artifactId>
- <optional>true</optional>
- </dependency>
-
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-autoconfigure</artifactId>
diff --git a/pom.xml b/pom.xml
index 9b52dd1..ffefee6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -45,8 +46,9 @@
<module>dubbo-spring-boot-distribution</module>
<module>dubbo-spring-boot-autoconfigure</module>
<module>dubbo-spring-boot-starter</module>
- <module>dubbo-spring-boot-samples</module>
<module>dubbo-spring-boot-actuator</module>
+ <module>dubbo-spring-boot-compatible</module>
+ <module>dubbo-spring-boot-samples</module>
</modules>
<organization>