diff --git a/spring-cloud-alibaba-dependencies/pom.xml b/spring-cloud-alibaba-dependencies/pom.xml index adcebb5d..bceea578 100644 --- a/spring-cloud-alibaba-dependencies/pom.xml +++ b/spring-cloud-alibaba-dependencies/pom.xml @@ -171,26 +171,11 @@ - - com.alibaba.fescar - fescar-core - ${fescar.version} - - - com.alibaba.fescar - fescar-common - ${fescar.version} - com.alibaba.fescar fescar-spring ${fescar.version} - - com.alibaba.fescar - fescar-rm-datasource - ${fescar.version} - diff --git a/spring-cloud-alibaba-examples/env-extension/pom.xml b/spring-cloud-alibaba-examples/env-extension/pom.xml deleted file mode 100644 index a505d954..00000000 --- a/spring-cloud-alibaba-examples/env-extension/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - org.springframework.boot - spring-boot-starter-parent - 1.5.16.RELEASE - - - - 4.0.0 - - alibaba.com - env-extension - 0.1.2.BUILD-SNAPSHOT - jar - - env-extension - Demo project for Spring Boot - - - - - org.springframework.boot - spring-boot-starter-web - provided - - - - diff --git a/spring-cloud-alibaba-examples/env-extension/src/main/java/org/springframework/alicloud/env/extension/ImportExtraConfig.java b/spring-cloud-alibaba-examples/env-extension/src/main/java/org/springframework/alicloud/env/extension/ImportExtraConfig.java deleted file mode 100644 index 494642de..00000000 --- a/spring-cloud-alibaba-examples/env-extension/src/main/java/org/springframework/alicloud/env/extension/ImportExtraConfig.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.springframework.alicloud.env.extension; - -import java.lang.annotation.*; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface ImportExtraConfig { - - String[] name() default ""; -} diff --git a/spring-cloud-alibaba-examples/env-extension/src/main/java/org/springframework/alicloud/env/extension/LoadExtraConfigApplicationListener.java b/spring-cloud-alibaba-examples/env-extension/src/main/java/org/springframework/alicloud/env/extension/LoadExtraConfigApplicationListener.java deleted file mode 100644 index 684513c0..00000000 --- a/spring-cloud-alibaba-examples/env-extension/src/main/java/org/springframework/alicloud/env/extension/LoadExtraConfigApplicationListener.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2019 the original author or authors. - * - * Licensed 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.springframework.alicloud.env.extension; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; -import org.springframework.context.ApplicationListener; -import org.springframework.core.env.PropertiesPropertySource; - -import java.io.FileInputStream; -import java.io.IOException; -import java.util.Properties; - -/** - * @author pbting - * @date 2019-01-09 7:39 PM - */ -public class LoadExtraConfigApplicationListener - implements ApplicationListener { - - @Override - public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) { - SpringApplication springApplication = event.getSpringApplication(); - Class clazz = springApplication.getMainApplicationClass(); - if (!clazz.isAnnotationPresent(ImportExtraConfig.class)) { - return; - } - ImportExtraConfig annotation = (ImportExtraConfig) clazz - .getAnnotation(ImportExtraConfig.class); - - String[] extraConfig = annotation.name(); - - if (extraConfig == null || extraConfig.length == 0) { - return; - } - - for (String config : extraConfig) { - try { - Properties properties = new Properties(); - properties.load(new FileInputStream(config)); - event.getEnvironment().getPropertySources() - .addFirst(new PropertiesPropertySource(config, properties)); - } - catch (IOException e) { - e.printStackTrace(); - } - } - } -} \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/env-extension/src/main/resources/META-INF/spring.factories b/spring-cloud-alibaba-examples/env-extension/src/main/resources/META-INF/spring.factories deleted file mode 100644 index d264a372..00000000 --- a/spring-cloud-alibaba-examples/env-extension/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.context.ApplicationListener=\ - org.springframework.alicloud.env.extension.LoadExtraConfigApplicationListener \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/account-service/pom.xml b/spring-cloud-alibaba-examples/fescar-example/account-service/pom.xml index 53f5c71f..c2f5e30d 100644 --- a/spring-cloud-alibaba-examples/fescar-example/account-service/pom.xml +++ b/spring-cloud-alibaba-examples/fescar-example/account-service/pom.xml @@ -34,30 +34,4 @@ mysql-connector-java - - - - - - org.codehaus.mojo - cobertura-maven-plugin - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.codehaus.mojo - cobertura-maven-plugin - false - - true - - - - - \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/DatabaseConfiguration.java b/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/DatabaseConfiguration.java index 6e6bf184..a92239e9 100644 --- a/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/DatabaseConfiguration.java +++ b/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/DatabaseConfiguration.java @@ -53,7 +53,7 @@ public class DatabaseConfiguration { String password = environment.getProperty("mysql.user.password"); DruidDataSource druidDataSource = new DruidDataSource(); - druidDataSource.setUrl("jdbc:mysql://" + ip + ":" + port + "/" + dbName); + druidDataSource.setUrl("jdbc:mysql://" + ip + ":" + port + "/" + dbName + "?serverTimezone=UTC"); druidDataSource.setUsername(userName); druidDataSource.setPassword(password); druidDataSource.setDriverClassName("com.mysql.jdbc.Driver"); diff --git a/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/application.properties b/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/application.properties index 10f45c59..68b91d01 100644 --- a/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/application.properties +++ b/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/application.properties @@ -5,5 +5,5 @@ mysql.server.ip=127.0.0.1 mysql.server.port=3306 mysql.db.name=demo -mysql.user.name=xxxxx -mysql.user.password=xxxxx \ No newline at end of file +mysql.user.name=root +mysql.user.password=123456 \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/application.conf b/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/file.conf similarity index 85% rename from spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/application.conf rename to spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/file.conf index b264dd9d..857b089e 100644 --- a/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/application.conf +++ b/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/file.conf @@ -3,6 +3,8 @@ transport { type = "TCP" #NIO NATIVE server = "NIO" + #enable heartbeat + heartbeat = true #thread factory for netty thread-factory { boss-thread-prefix = "NettyBoss" @@ -28,3 +30,11 @@ service { #disable disable = false } + +client { + async.commit.buffer.limit = 10000 + lock { + retry.internal = 10 + retry.times = 30 + } +} \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/registry.conf b/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/registry.conf new file mode 100644 index 00000000..8a79c9f2 --- /dev/null +++ b/spring-cloud-alibaba-examples/fescar-example/account-service/src/main/resources/registry.conf @@ -0,0 +1,35 @@ +registry { + # file 、nacos 、redis + type = "file" + + nacos { + serverAddr = "localhost" + namespace = "public" + cluster = "default" + } + redis { + serverAddr = "localhost:6379" + db = "0" + } + file { + name = "file.conf" + } +} + +config { + # file nacos apollo + type = "file" + + nacos { + serverAddr = "localhost" + namespace = "public" + cluster = "default" + } + apollo { + app.id = "fescar-server" + apollo.meta = "http://192.168.1.204:8801" + } + file { + name = "file.conf" + } +} \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/business-service/pom.xml b/spring-cloud-alibaba-examples/fescar-example/business-service/pom.xml index 598ea5ce..127a8c29 100644 --- a/spring-cloud-alibaba-examples/fescar-example/business-service/pom.xml +++ b/spring-cloud-alibaba-examples/fescar-example/business-service/pom.xml @@ -38,25 +38,4 @@ - - - - - org.codehaus.mojo - cobertura-maven-plugin - - - - - - org.codehaus.mojo - cobertura-maven-plugin - false - - true - - - - - \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/business-service/src/main/resources/application.conf b/spring-cloud-alibaba-examples/fescar-example/business-service/src/main/resources/file.conf similarity index 85% rename from spring-cloud-alibaba-examples/fescar-example/business-service/src/main/resources/application.conf rename to spring-cloud-alibaba-examples/fescar-example/business-service/src/main/resources/file.conf index 65b69508..b087a18c 100644 --- a/spring-cloud-alibaba-examples/fescar-example/business-service/src/main/resources/application.conf +++ b/spring-cloud-alibaba-examples/fescar-example/business-service/src/main/resources/file.conf @@ -3,6 +3,8 @@ transport { type = "TCP" #NIO NATIVE server = "NIO" + #enable heartbeat + heartbeat = true #thread factory for netty thread-factory { boss-thread-prefix = "NettyBoss" @@ -28,3 +30,11 @@ service { #disable disable = false } + +client { + async.commit.buffer.limit = 10000 + lock { + retry.internal = 10 + retry.times = 30 + } +} \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/business-service/src/main/resources/registry.conf b/spring-cloud-alibaba-examples/fescar-example/business-service/src/main/resources/registry.conf new file mode 100644 index 00000000..8a79c9f2 --- /dev/null +++ b/spring-cloud-alibaba-examples/fescar-example/business-service/src/main/resources/registry.conf @@ -0,0 +1,35 @@ +registry { + # file 、nacos 、redis + type = "file" + + nacos { + serverAddr = "localhost" + namespace = "public" + cluster = "default" + } + redis { + serverAddr = "localhost:6379" + db = "0" + } + file { + name = "file.conf" + } +} + +config { + # file nacos apollo + type = "file" + + nacos { + serverAddr = "localhost" + namespace = "public" + cluster = "default" + } + apollo { + app.id = "fescar-server" + apollo.meta = "http://192.168.1.204:8801" + } + file { + name = "file.conf" + } +} \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/order-service/pom.xml b/spring-cloud-alibaba-examples/fescar-example/order-service/pom.xml index 4c821499..cdec2dfb 100644 --- a/spring-cloud-alibaba-examples/fescar-example/order-service/pom.xml +++ b/spring-cloud-alibaba-examples/fescar-example/order-service/pom.xml @@ -35,29 +35,5 @@ - - - - - org.codehaus.mojo - cobertura-maven-plugin - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.codehaus.mojo - cobertura-maven-plugin - false - - true - - - - - + \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/DatabaseConfiguration.java b/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/DatabaseConfiguration.java index 4519a37a..dfc8b027 100644 --- a/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/DatabaseConfiguration.java +++ b/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/DatabaseConfiguration.java @@ -53,7 +53,8 @@ public class DatabaseConfiguration { String password = env.getProperty("mysql.user.password"); DruidDataSource druidDataSource = new DruidDataSource(); - druidDataSource.setUrl("jdbc:mysql://" + ip + ":" + port + "/" + dbName); + druidDataSource.setUrl( + "jdbc:mysql://" + ip + ":" + port + "/" + dbName + "?serverTimezone=UTC"); druidDataSource.setUsername(userName); druidDataSource.setPassword(password); druidDataSource.setDriverClassName("com.mysql.jdbc.Driver"); diff --git a/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/OrderController.java b/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/OrderController.java index 2e0e0f81..d215588d 100644 --- a/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/OrderController.java +++ b/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/OrderController.java @@ -16,11 +16,6 @@ package org.springframework.cloud.alibaba.cloud.examples; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.Random; - import com.alibaba.fescar.core.context.RootContext; import org.slf4j.Logger; @@ -40,6 +35,11 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.Random; + /** * @author xiaojing */ @@ -94,7 +94,7 @@ public class OrderController { } }, keyHolder); - order.id = (long) keyHolder.getKey(); + order.id = keyHolder.getKey().longValue(); if (random.nextBoolean()) { throw new RuntimeException("this is a mock Exception"); diff --git a/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/application.properties b/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/application.properties index f3e417d8..c88342af 100644 --- a/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/application.properties +++ b/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/application.properties @@ -5,5 +5,5 @@ mysql.server.ip=127.0.0.1 mysql.server.port=3306 mysql.db.name=demo -mysql.user.name=xxxxx -mysql.user.password=xxxxx \ No newline at end of file +mysql.user.name=root +mysql.user.password=123456 \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/application.conf b/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/file.conf similarity index 85% rename from spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/application.conf rename to spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/file.conf index c298ca0c..4f893da5 100644 --- a/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/application.conf +++ b/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/file.conf @@ -3,6 +3,8 @@ transport { type = "TCP" #NIO NATIVE server = "NIO" + #enable heartbeat + heartbeat = true #thread factory for netty thread-factory { boss-thread-prefix = "NettyBoss" @@ -28,3 +30,11 @@ service { #disable disable = false } + +client { + async.commit.buffer.limit = 10000 + lock { + retry.internal = 10 + retry.times = 30 + } +} \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/registry.conf b/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/registry.conf new file mode 100644 index 00000000..8a79c9f2 --- /dev/null +++ b/spring-cloud-alibaba-examples/fescar-example/order-service/src/main/resources/registry.conf @@ -0,0 +1,35 @@ +registry { + # file 、nacos 、redis + type = "file" + + nacos { + serverAddr = "localhost" + namespace = "public" + cluster = "default" + } + redis { + serverAddr = "localhost:6379" + db = "0" + } + file { + name = "file.conf" + } +} + +config { + # file nacos apollo + type = "file" + + nacos { + serverAddr = "localhost" + namespace = "public" + cluster = "default" + } + apollo { + app.id = "fescar-server" + apollo.meta = "http://192.168.1.204:8801" + } + file { + name = "file.conf" + } +} \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/storage-service/pom.xml b/spring-cloud-alibaba-examples/fescar-example/storage-service/pom.xml index 261ffba0..792ff5f3 100644 --- a/spring-cloud-alibaba-examples/fescar-example/storage-service/pom.xml +++ b/spring-cloud-alibaba-examples/fescar-example/storage-service/pom.xml @@ -39,30 +39,4 @@ mysql-connector-java - - - - - - org.codehaus.mojo - cobertura-maven-plugin - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.codehaus.mojo - cobertura-maven-plugin - false - - true - - - - - \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/DatabaseConfiguration.java b/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/DatabaseConfiguration.java index 9f41dc24..7e7fdf2f 100644 --- a/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/DatabaseConfiguration.java +++ b/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/java/org/springframework/cloud/alibaba/cloud/examples/DatabaseConfiguration.java @@ -54,7 +54,7 @@ public class DatabaseConfiguration { String password = environment.getProperty("mysql.user.password"); DruidDataSource druidDataSource = new DruidDataSource(); - druidDataSource.setUrl("jdbc:mysql://" + ip + ":" + port + "/" + dbName); + druidDataSource.setUrl("jdbc:mysql://" + ip + ":" + port + "/" + dbName + "?serverTimezone=UTC"); druidDataSource.setUsername(userName); druidDataSource.setPassword(password); druidDataSource.setDriverClassName("com.mysql.jdbc.Driver"); diff --git a/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/application.properties b/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/application.properties index 832eaecd..b65047c8 100644 --- a/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/application.properties +++ b/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/application.properties @@ -5,5 +5,5 @@ mysql.server.ip=127.0.0.1 mysql.server.port=3306 mysql.db.name=demo -mysql.user.name=xxxxx -mysql.user.password=xxxxx \ No newline at end of file +mysql.user.name=root +mysql.user.password=123456 \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/application.conf b/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/file.conf similarity index 85% rename from spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/application.conf rename to spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/file.conf index 4bc5989e..29c81842 100644 --- a/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/application.conf +++ b/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/file.conf @@ -3,6 +3,8 @@ transport { type = "TCP" #NIO NATIVE server = "NIO" + #enable heartbeat + heartbeat = true #thread factory for netty thread-factory { boss-thread-prefix = "NettyBoss" @@ -28,3 +30,11 @@ service { #disable disable = false } + +client { + async.commit.buffer.limit = 10000 + lock { + retry.internal = 10 + retry.times = 30 + } +} \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/registry.conf b/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/registry.conf new file mode 100644 index 00000000..8a79c9f2 --- /dev/null +++ b/spring-cloud-alibaba-examples/fescar-example/storage-service/src/main/resources/registry.conf @@ -0,0 +1,35 @@ +registry { + # file 、nacos 、redis + type = "file" + + nacos { + serverAddr = "localhost" + namespace = "public" + cluster = "default" + } + redis { + serverAddr = "localhost:6379" + db = "0" + } + file { + name = "file.conf" + } +} + +config { + # file nacos apollo + type = "file" + + nacos { + serverAddr = "localhost" + namespace = "public" + cluster = "default" + } + apollo { + app.id = "fescar-server" + apollo.meta = "http://192.168.1.204:8801" + } + file { + name = "file.conf" + } +} \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/pom.xml b/spring-cloud-alibaba-examples/pom.xml index 5b328708..40f867bc 100644 --- a/spring-cloud-alibaba-examples/pom.xml +++ b/spring-cloud-alibaba-examples/pom.xml @@ -33,7 +33,6 @@ acm-example/acm-local-example rocketmq-example/rocketmq-consume-example rocketmq-example/rocketmq-produce-example - env-extension sms-example spring-cloud-bus-rocketmq-example schedulerx-example/schedulerx-simple-task-example diff --git a/spring-cloud-alibaba-fescar/pom.xml b/spring-cloud-alibaba-fescar/pom.xml index 32b75969..c69c9c64 100644 --- a/spring-cloud-alibaba-fescar/pom.xml +++ b/spring-cloud-alibaba-fescar/pom.xml @@ -15,22 +15,10 @@ - - com.alibaba.fescar - fescar-core - - - com.alibaba.fescar - fescar-common - com.alibaba.fescar fescar-spring - - com.alibaba.fescar - fescar-rm-datasource - org.springframework.cloud diff --git a/spring-cloud-alibaba-nacos-config/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-cloud-alibaba-nacos-config/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 3ce2a169..597126e8 100644 --- a/spring-cloud-alibaba-nacos-config/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-cloud-alibaba-nacos-config/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -32,6 +32,12 @@ "name": "spring.cloud.nacos.config.ext-config", "type": "java.util.List", "description": "a set of extended configurations ." + }, + { + "name": "spring.cloud.nacos.config.enabled", + "type": "java.lang.Boolean", + "defaultValue": true, + "description": "enable nacos config or not." } ] } \ No newline at end of file diff --git a/spring-cloud-alicloud-acm/src/main/java/org/springframework/cloud/alicloud/acm/bootstrap/AcmPropertySourceBuilder.java b/spring-cloud-alicloud-acm/src/main/java/org/springframework/cloud/alicloud/acm/bootstrap/AcmPropertySourceBuilder.java index 7afabd83..b4a96a3e 100644 --- a/spring-cloud-alicloud-acm/src/main/java/org/springframework/cloud/alicloud/acm/bootstrap/AcmPropertySourceBuilder.java +++ b/spring-cloud-alicloud-acm/src/main/java/org/springframework/cloud/alicloud/acm/bootstrap/AcmPropertySourceBuilder.java @@ -25,7 +25,11 @@ import org.springframework.core.io.ByteArrayResource; import org.springframework.util.StringUtils; import java.io.StringReader; -import java.util.*; +import java.util.Date; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; /** * @author juven.xuxb diff --git a/spring-cloud-alicloud-acm/src/main/java/org/springframework/cloud/alicloud/acm/refresh/AcmContextRefresher.java b/spring-cloud-alicloud-acm/src/main/java/org/springframework/cloud/alicloud/acm/refresh/AcmContextRefresher.java index 18308b59..4a9b97b7 100644 --- a/spring-cloud-alicloud-acm/src/main/java/org/springframework/cloud/alicloud/acm/refresh/AcmContextRefresher.java +++ b/spring-cloud-alicloud-acm/src/main/java/org/springframework/cloud/alicloud/acm/refresh/AcmContextRefresher.java @@ -16,12 +16,8 @@ package org.springframework.cloud.alicloud.acm.refresh; -import java.io.UnsupportedEncodingException; -import java.math.BigInteger; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; +import com.alibaba.edas.acm.ConfigService; +import com.alibaba.edas.acm.listener.ConfigChangeListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,8 +32,12 @@ import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationListener; import org.springframework.util.StringUtils; -import com.alibaba.edas.acm.ConfigService; -import com.alibaba.edas.acm.listener.ConfigChangeListener; +import java.io.UnsupportedEncodingException; +import java.math.BigInteger; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; /** * On application start up, AcmContextRefresher add diamond listeners to all application