From ef1844953ddf9a2e32f84667e7f1cedeadf201c9 Mon Sep 17 00:00:00 2001 From: knightliao Date: Mon, 18 Jul 2016 10:47:38 +0800 Subject: [PATCH 01/45] re --- disconf-client/pom.xml | 2 +- disconf-core/pom.xml | 2 +- disconf-web/pom.xml | 2 +- pom.xml | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/disconf-client/pom.xml b/disconf-client/pom.xml index 9a3ae4f07..193b3e8ad 100644 --- a/disconf-client/pom.xml +++ b/disconf-client/pom.xml @@ -10,7 +10,7 @@ com.baidu.disconf disconf-base - 2.6.35 + 2.6.36-SNAPSHOT diff --git a/disconf-core/pom.xml b/disconf-core/pom.xml index 5a88a75a7..6df47a981 100644 --- a/disconf-core/pom.xml +++ b/disconf-core/pom.xml @@ -13,7 +13,7 @@ com.baidu.disconf disconf-base - 2.6.35 + 2.6.36-SNAPSHOT diff --git a/disconf-web/pom.xml b/disconf-web/pom.xml index cb8fb070f..74a51b835 100644 --- a/disconf-web/pom.xml +++ b/disconf-web/pom.xml @@ -12,7 +12,7 @@ com.baidu.disconf disconf-base - 2.6.35 + 2.6.36-SNAPSHOT diff --git a/pom.xml b/pom.xml index e0d1236a6..0242dadf5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.baidu.disconf disconf-base - 2.6.35 + 2.6.36-SNAPSHOT pom @@ -25,9 +25,9 @@ - 2.6.35 - 2.6.35 - 2.6.35 + 2.6.36-SNAPSHOT + 2.6.36-SNAPSHOT + 2.6.36-SNAPSHOT UTF-8 From 454ef50c23914d6dd7d87f49a024f7fbb3b1e3f4 Mon Sep 17 00:00:00 2001 From: knightliao Date: Wed, 31 Aug 2016 21:24:40 +0800 Subject: [PATCH 02/45] re --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5e8adb000..252db4ceb 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ https://github.com/knightliao/disconf-demos-java - Java: 目前唯一支持语言 - python:打算支持 - PHP:暂未支持 + - Node: https://github.com/Corey600/node-disconf-client - WEB 管理端: - Java SpringMvc 实现,前后端分离 实现方式(基于Spring 4.1.7.RELEASE) From 91220645978526355afb3b84a08ad6588696ac81 Mon Sep 17 00:00:00 2001 From: knightliao Date: Mon, 5 Sep 2016 17:58:46 +0800 Subject: [PATCH 03/45] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=92=8C=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9=E5=8F=AF=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89app=20https://github.com/knightliao/disconf/issues/147?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../disconf/client/common/annotations/DisconfFile.java | 5 +++++ .../disconf/client/common/annotations/DisconfItem.java | 5 +++++ .../inner/statically/impl/StaticScannerFileMgrImpl.java | 3 ++- .../inner/statically/impl/StaticScannerItemMgrImpl.java | 3 ++- .../inner/statically/impl/StaticScannerMgrImplBase.java | 8 ++++++-- .../impl/StaticScannerNonAnnotationFileMgrImpl.java | 2 +- 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/disconf-client/src/main/java/com/baidu/disconf/client/common/annotations/DisconfFile.java b/disconf-client/src/main/java/com/baidu/disconf/client/common/annotations/DisconfFile.java index cc7b7123f..99d044f13 100644 --- a/disconf-client/src/main/java/com/baidu/disconf/client/common/annotations/DisconfFile.java +++ b/disconf-client/src/main/java/com/baidu/disconf/client/common/annotations/DisconfFile.java @@ -32,6 +32,11 @@ */ String version() default ""; + /** + * 版本,默认为用户指定的app + */ + String app() default ""; + /** * 以"/"开头则是系统的全路径,否则则是相对于classpath的路径,默认是classpath根路径 * 注意:根路径要注意是否有权限,否则会出现找不到路径,推荐采用相对路径 diff --git a/disconf-client/src/main/java/com/baidu/disconf/client/common/annotations/DisconfItem.java b/disconf-client/src/main/java/com/baidu/disconf/client/common/annotations/DisconfItem.java index ae14e3663..cf7a85fca 100644 --- a/disconf-client/src/main/java/com/baidu/disconf/client/common/annotations/DisconfItem.java +++ b/disconf-client/src/main/java/com/baidu/disconf/client/common/annotations/DisconfItem.java @@ -32,6 +32,11 @@ */ String env() default ""; + /** + * 版本,默认为用户指定的app + */ + String app() default ""; + /** * 版本,默认为用户指定的版本 */ diff --git a/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerFileMgrImpl.java b/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerFileMgrImpl.java index 8c1f63d0a..6f9834ec2 100644 --- a/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerFileMgrImpl.java +++ b/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerFileMgrImpl.java @@ -105,7 +105,8 @@ private static DisconfCenterFile transformScanFile(Class disconfFileClass, Se // // disConfCommonModel DisConfCommonModel disConfCommonModel = - makeDisConfCommonModel(disconfFileAnnotation.env(), disconfFileAnnotation.version()); + makeDisConfCommonModel(disconfFileAnnotation.app(), disconfFileAnnotation.env(), disconfFileAnnotation + .version()); disconfCenterFile.setDisConfCommonModel(disConfCommonModel); // Remote URL diff --git a/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerItemMgrImpl.java b/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerItemMgrImpl.java index 940eebd6e..44c635ae5 100644 --- a/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerItemMgrImpl.java +++ b/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerItemMgrImpl.java @@ -122,7 +122,8 @@ private static DisconfCenterItem transformScanItem(Method method) { // // disConfCommonModel - DisConfCommonModel disConfCommonModel = makeDisConfCommonModel(disconfItem.env(), disconfItem.version()); + DisConfCommonModel disConfCommonModel = makeDisConfCommonModel(disconfItem.app(), disconfItem.env(), + disconfItem.version()); disconfCenterItem.setDisConfCommonModel(disConfCommonModel); // Disconf-web url diff --git a/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerMgrImplBase.java b/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerMgrImplBase.java index 9ee28823b..4a6fb2ba4 100644 --- a/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerMgrImplBase.java +++ b/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerMgrImplBase.java @@ -12,12 +12,16 @@ public class StaticScannerMgrImplBase { /** * env/version 默认是应用整合设置的,但用户可以在配置中更改它 */ - protected static DisConfCommonModel makeDisConfCommonModel(String env, String version) { + protected static DisConfCommonModel makeDisConfCommonModel(String app, String env, String version) { DisConfCommonModel disConfCommonModel = new DisConfCommonModel(); // app - disConfCommonModel.setApp(DisClientConfig.getInstance().APP); + if (!app.isEmpty()) { + disConfCommonModel.setApp(app); + } else { + disConfCommonModel.setApp(DisClientConfig.getInstance().APP); + } // env if (!env.isEmpty()) { diff --git a/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerNonAnnotationFileMgrImpl.java b/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerNonAnnotationFileMgrImpl.java index 7b7c2367a..cb6e5914e 100644 --- a/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerNonAnnotationFileMgrImpl.java +++ b/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerNonAnnotationFileMgrImpl.java @@ -89,7 +89,7 @@ public static DisconfCenterBaseModel getDisconfCenterFile(String fileName) { // // disConfCommonModel - DisConfCommonModel disConfCommonModel = makeDisConfCommonModel("", ""); + DisConfCommonModel disConfCommonModel = makeDisConfCommonModel("", "", ""); disconfCenterFile.setDisConfCommonModel(disConfCommonModel); // Remote URL From bdba14a5d0b7521302ac7c806292dc63f4bd4faf Mon Sep 17 00:00:00 2001 From: knightliao Date: Mon, 5 Sep 2016 18:15:26 +0800 Subject: [PATCH 04/45] https://github.com/knightliao/disconf/issues/158 --- .../baidu/disconf/core/common/restful/core/RemoteUrl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/core/RemoteUrl.java b/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/core/RemoteUrl.java index d26b1d470..5746106a8 100644 --- a/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/core/RemoteUrl.java +++ b/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/core/RemoteUrl.java @@ -32,8 +32,11 @@ public RemoteUrl(String url, List serverList) { try { - if (!server.contains("http://")) { - server = "http://" + server; + if (!server.startsWith("http://")) { + if (server.startsWith("https://")) { + } else { + server = "http://" + server; + } } urls.add(new URL(server + url)); From 0eb8bfd922d318369920b5326440151da1cc43f6 Mon Sep 17 00:00:00 2001 From: knightliao Date: Tue, 6 Sep 2016 11:05:15 +0800 Subject: [PATCH 05/45] use debug to log no use dynamic properties --- .../properties/ReloadingPropertyPlaceholderConfigurer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disconf-client/src/main/java/com/baidu/disconf/client/addons/properties/ReloadingPropertyPlaceholderConfigurer.java b/disconf-client/src/main/java/com/baidu/disconf/client/addons/properties/ReloadingPropertyPlaceholderConfigurer.java index 85b09bdb6..341e0163f 100644 --- a/disconf-client/src/main/java/com/baidu/disconf/client/addons/properties/ReloadingPropertyPlaceholderConfigurer.java +++ b/disconf-client/src/main/java/com/baidu/disconf/client/addons/properties/ReloadingPropertyPlaceholderConfigurer.java @@ -84,7 +84,7 @@ protected String parseStringValue(String strVal, Properties props, Set visitedPl } addDependency(dynamic, placeholder); } else { - logger.warn("dynamic property outside bean property value - ignored: " + strVal); + logger.debug("dynamic property outside bean property value - ignored: " + strVal); } startIndex = endIndex - this.placeholderPrefix.length() + this.placeholderPrefix.length() + this.placeholderSuffix.length(); From e45692dd108a2701e9cb9a12f3aa5f8273b202e0 Mon Sep 17 00:00:00 2001 From: knightliao Date: Tue, 6 Sep 2016 11:17:36 +0800 Subject: [PATCH 06/45] re --- disconf-web/sql/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/disconf-web/sql/readme.md b/disconf-web/sql/readme.md index e4846417e..63e7acaa3 100644 --- a/disconf-web/sql/readme.md +++ b/disconf-web/sql/readme.md @@ -3,3 +3,4 @@ - 0-init_table.sql create db,tables - 1-init_data.sql create data - 201512/20151225.sql patch +- 20160701/20160701.sql patch From c61feb7f018dd1a21cd72006baad9d60ed11c960 Mon Sep 17 00:00:00 2001 From: knightliao Date: Thu, 8 Sep 2016 16:47:48 +0800 Subject: [PATCH 07/45] =?UTF-8?q?fix=20bug:=20class=20path=20=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E6=94=AF=E6=8C=81windows=E7=8E=AF=E5=A2=83=20https://?= =?UTF-8?q?github.com/knightliao/disconf/issues/166#event-780682843?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/baidu/disconf/core/common/utils/ClassLoaderUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/disconf-core/src/main/java/com/baidu/disconf/core/common/utils/ClassLoaderUtil.java b/disconf-core/src/main/java/com/baidu/disconf/core/common/utils/ClassLoaderUtil.java index ab7b14b7d..038cec7bf 100644 --- a/disconf-core/src/main/java/com/baidu/disconf/core/common/utils/ClassLoaderUtil.java +++ b/disconf-core/src/main/java/com/baidu/disconf/core/common/utils/ClassLoaderUtil.java @@ -39,7 +39,8 @@ private ClassLoaderUtil() { java.net.URL url = loader.getResource(""); // get class path - classPath = url.getPath(); + File f=new File(url.toURI()); + classPath = f.getAbsolutePath(); classPath = URLDecoder.decode(classPath, "utf-8"); // 如果是jar包内的,则返回当前路径 From c4bf256e461ad93a070038bebfe343ea08263062 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 11:31:41 +0800 Subject: [PATCH 08/45] re --- README.md | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/README.md b/README.md index 5ded8ad21..60add3cdc 100644 --- a/README.md +++ b/README.md @@ -28,26 +28,6 @@ Distributed Configuration Management Platform(分布式配置管理平台) ## 版本 -请在dev上进行提交代码 - -## 项目信息 - -- CLIENT 端: - - Java: 目前唯一支持语言 - - python:打算支持 - - PHP:暂未支持 - - Node: https://github.com/Corey600/node-disconf-client -- WEB 管理端: - - Java SpringMvc 实现,前后端分离 实现方式(基于Spring 4.1.7.RELEASE) - -### java client - -disconf.git branches and Maven version: - -- dev(develop branch): 2.6.35 -- master(stable branch):2.6.35 -- [更新日志](https://github.com/knightliao/disconf/wiki/updates) -======= - dev(latest branch): 2.6.36-SNAPSHOT - master(cooperate && contribute branch):2.6.35 - stable(release && stable branch): 2.6.35 From a5a05eaf5c58d075283fb466945ec26bc9f6b124 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 20:57:55 +0800 Subject: [PATCH 09/45] =?UTF-8?q?=E5=88=A0=E9=99=A4=20DisconfMgrJustHostFi?= =?UTF-8?q?leBean?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybeans/DisconfMgrJustHostFileBean.java | 67 ------------------- docs/source/index.rst | 1 + docs/source/install/src/02.rst | 4 +- docs/source/others/update.md | 11 +++ docs/source/tutorial-client/Tutorial5.md | 3 +- docs/source/tutorial-client/src/Tutorial5.rst | 6 +- .../tutorial-client/src/jar-start-up.rst | 3 +- .../12-open-api-for-web-client.md | 12 ++-- .../src/12-open-api-for-web-client.rst | 12 ++-- 9 files changed, 32 insertions(+), 87 deletions(-) delete mode 100644 disconf-client/src/main/java/com/baidu/disconf/client/mybeans/DisconfMgrJustHostFileBean.java create mode 100644 docs/source/others/update.md diff --git a/disconf-client/src/main/java/com/baidu/disconf/client/mybeans/DisconfMgrJustHostFileBean.java b/disconf-client/src/main/java/com/baidu/disconf/client/mybeans/DisconfMgrJustHostFileBean.java deleted file mode 100644 index 0c08f490d..000000000 --- a/disconf-client/src/main/java/com/baidu/disconf/client/mybeans/DisconfMgrJustHostFileBean.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.baidu.disconf.client.mybeans; - -import java.util.HashSet; -import java.util.Set; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; -import org.springframework.core.Ordered; -import org.springframework.core.PriorityOrdered; - -import com.baidu.disconf.client.store.inner.DisconfCenterHostFilesStore; - -/** - * 进行配置文件托管的bean: 启动时自动下载此配置;更改配置时,亦会自动下载此配置。不会进行java bean类的注入。 - * - * @author knightliao - */ -@Deprecated -public class DisconfMgrJustHostFileBean implements BeanDefinitionRegistryPostProcessor, PriorityOrdered { - - protected static final Logger log = LoggerFactory.getLogger(DisconfMgrJustHostFileBean.class); - - private Set justHostFiles = new HashSet(); - - @Override - public String toString() { - return "DisconfMgrJustHostFileBean [justHostFiles=" + justHostFiles + "]"; - } - - public Set getJustHostFiles() { - return justHostFiles; - } - - public void setJustHostFiles(Set justHostFiles) { - this.justHostFiles = justHostFiles; - } - - @Override - public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { - } - - @Override - public int getOrder() { - return Ordered.HIGHEST_PRECEDENCE; - } - - @Override - public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { - - if (justHostFiles != null) { - - for (String file : justHostFiles) { - if (file != null) { - String fileName = file.trim(); - log.debug("disconf no-reloadable file: " + fileName); - // 添加到配置文件托管列表里 - DisconfCenterHostFilesStore.getInstance().addJustHostFile(fileName); - } - } - } - } - -} \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index 5f4a27bbc..c32f868ad 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -26,4 +26,5 @@ Distributed Configuration Management Platform(分布式配置管理平台) question/index others/src/contribute others/src/sponsor + design/src/update design/index diff --git a/docs/source/install/src/02.rst b/docs/source/install/src/02.rst index 9f172f585..469252be2 100644 --- a/docs/source/install/src/02.rst +++ b/docs/source/install/src/02.rst @@ -77,7 +77,7 @@ How to deploy :: - home/work/dsp/disconf-rd/online-resources + /home/work/dsp/disconf-rd/online-resources **如果不确定如何配置,可以拷贝/disconf-web/profile/rd/目录下的文件,拷贝过去后修改即可。** @@ -243,7 +243,7 @@ Nginx(处理静态请求) + Tomcat(处理动态请求) - **后端** - - SpringMvc(3.1.2+) + - SpringMvc(Spring 4.1.7.RELEASE) - Jdbc-Template - Mysql - RestFul API diff --git a/docs/source/others/update.md b/docs/source/others/update.md new file mode 100644 index 000000000..acef581dd --- /dev/null +++ b/docs/source/others/update.md @@ -0,0 +1,11 @@ + +## 2.6.36 + +待发布 + +- disconf-web: + - 配置和配置项可支持自定义app https://github.com/knightliao/disconf/issues/147 +- disconf-client: + - 支持https的web端 https://github.com/knightliao/disconf/issues/158 + - path支持windows: https://github.com/knightliao/disconf/issues/166 + - 删除类 DisconfMgrJustHostFileBean \ No newline at end of file diff --git a/docs/source/tutorial-client/Tutorial5.md b/docs/source/tutorial-client/Tutorial5.md index 0ff26c9ce..76d469e3a 100644 --- a/docs/source/tutorial-client/Tutorial5.md +++ b/docs/source/tutorial-client/Tutorial5.md @@ -1,8 +1,7 @@ Tutorial 5 基于XML的分布式配置文件管理,不会自动reload ======= -在 [Tutorial 1](Tutorial1.html) 里, -我们实现了一个简单的Redis服务程序,它使用分布式配置进行管理,此Redis的配置文件存储在分布式服务器 disconf-web 上。它使用的是注解式的配置管理。 +在 [Tutorial 1](Tutorial1.html) 里, 我们实现了一个简单的Redis服务程序,它使用分布式配置进行管理,此Redis的配置文件存储在分布式服务器 disconf-web 上。它使用的是注解式的配置管理。 Disconf亦支持非注解式的分布式配置管理,下面定义一下概念: diff --git a/docs/source/tutorial-client/src/Tutorial5.rst b/docs/source/tutorial-client/src/Tutorial5.rst index 4ea725e1c..3bebf3a2d 100644 --- a/docs/source/tutorial-client/src/Tutorial5.rst +++ b/docs/source/tutorial-client/src/Tutorial5.rst @@ -1,9 +1,9 @@ Tutorial 5 基于XML的分布式配置文件管理,不会自动reload ===================================================== -| 在 `Tutorial 1 `__ 里, -| 我们实现了一个简单的Redis服务程序,它使用分布式配置进行管理,此Redis的配置文件存储在分布式服务器 - disconf-web 上。它使用的是注解式的配置管理。 +在 `Tutorial 1 `__ 里, +我们实现了一个简单的Redis服务程序,它使用分布式配置进行管理,此Redis的配置文件存储在分布式服务器 +disconf-web 上。它使用的是注解式的配置管理。 Disconf亦支持非注解式的分布式配置管理,下面定义一下概念: diff --git a/docs/source/tutorial-client/src/jar-start-up.rst b/docs/source/tutorial-client/src/jar-start-up.rst index 5b360b28b..44fb89a74 100644 --- a/docs/source/tutorial-client/src/jar-start-up.rst +++ b/docs/source/tutorial-client/src/jar-start-up.rst @@ -7,7 +7,8 @@ 主要升级点 ~~~~~~~~~~ -当使用以-jar方式启动的程序(非tomcat,web方式)时,例如springboot时,可以无缝对接(不会出现配置文件找不到的情况) +当使用以 -jar 方式启动的程序(非tomcat,web方式)时,例如 springboot +时,可以无缝对接(不会出现配置文件找不到的情况) 正确的使用方式 ~~~~~~~~~~~~~~ diff --git a/docs/source/tutorial-web/12-open-api-for-web-client.md b/docs/source/tutorial-web/12-open-api-for-web-client.md index e1f0516e0..0faa792f4 100644 --- a/docs/source/tutorial-web/12-open-api-for-web-client.md +++ b/docs/source/tutorial-web/12-open-api-for-web-client.md @@ -1,21 +1,21 @@ Tutorial 12 disconf-web 为客户端 开放的 Http API ======= -# 前言 +## 前言 - 目标:让开发者具有自定义开发客户端的能力 - 目前已经支持 java -# 准备 +## 准备 - 1. 获取配置时是从disconf-web获取 - 2. 得到配置更新时是从ZK上获取,得到通知后,再从disconf-web上获取配置值 -## 获取配置接口 +### 获取配置接口 以下接口均不需要权限控制,Http-Rest 风格 -### /api/config/item +#### /api/config/item - 描述:获取配置项 - url示例: /api/config/item?app=disconf_demo&env=rd&version=1_0_0_0&key=discountRate @@ -39,7 +39,7 @@ Tutorial 12 disconf-web 为客户端 开放的 Http API {"status":1,"message":"","value":"0.5"} -### /api/config/file +#### /api/config/file - 描述:获取配置文件 - url示例: /api/config/file?app=disconf_demo&env=rd&version=1_0_0_0&key=autoconfig.properties @@ -61,7 +61,7 @@ Tutorial 12 disconf-web 为客户端 开放的 Http API xx% -## 得到更新通知的接口 +### 得到更新通知的接口 客户端程序需要进行订阅ZK结点 diff --git a/docs/source/tutorial-web/src/12-open-api-for-web-client.rst b/docs/source/tutorial-web/src/12-open-api-for-web-client.rst index fda2aad64..003b3782f 100644 --- a/docs/source/tutorial-web/src/12-open-api-for-web-client.rst +++ b/docs/source/tutorial-web/src/12-open-api-for-web-client.rst @@ -2,13 +2,13 @@ Tutorial 12 disconf-web 为客户端 开放的 Http API ================================================ 前言 -==== +---- - 目标:让开发者具有自定义开发客户端的能力 - 目前已经支持 java 准备 -==== +---- - @@ -19,12 +19,12 @@ Tutorial 12 disconf-web 为客户端 开放的 Http API #. 得到配置更新时是从ZK上获取,得到通知后,再从disconf-web上获取配置值 获取配置接口 ------------- +~~~~~~~~~~~~ 以下接口均不需要权限控制,Http-Rest 风格 /api/config/item -~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^ - 描述:获取配置项 - url示例: @@ -56,7 +56,7 @@ Tutorial 12 disconf-web 为客户端 开放的 Http API {"status":1,"message":"","value":"0.5"} /api/config/file -~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^ - 描述:获取配置文件 - url示例: @@ -86,7 +86,7 @@ Tutorial 12 disconf-web 为客户端 开放的 Http API xx% 得到更新通知的接口 ------------------- +~~~~~~~~~~~~~~~~~~ 客户端程序需要进行订阅ZK结点 From 105ce0aa511fefc3be79ffcb4b92da641061dfd4 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 20:58:23 +0800 Subject: [PATCH 10/45] add update.rst --- docs/source/others/src/update.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 docs/source/others/src/update.rst diff --git a/docs/source/others/src/update.rst b/docs/source/others/src/update.rst new file mode 100644 index 000000000..84edec8a3 --- /dev/null +++ b/docs/source/others/src/update.rst @@ -0,0 +1,15 @@ +2.6.36 +------ + +待发布 + +- disconf-web: + + - 配置和配置项可支持自定义app + https://github.com/knightliao/disconf/issues/147 + +- disconf-client: + + - 支持https的web端 https://github.com/knightliao/disconf/issues/158 + - path支持windows: https://github.com/knightliao/disconf/issues/166 + - 删除类 DisconfMgrJustHostFileBean From b7c9a2059b3e67fd9dfd28a84337579c89074579 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 21:02:06 +0800 Subject: [PATCH 11/45] re --- docs/source/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index c32f868ad..6f746162a 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -26,5 +26,5 @@ Distributed Configuration Management Platform(分布式配置管理平台) question/index others/src/contribute others/src/sponsor - design/src/update + others/src/update design/index From 5973d8058df8308e46f9988a6bee9bfa14993709 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 21:03:59 +0800 Subject: [PATCH 12/45] re --- docs/source/others/src/update.rst | 6 +++--- docs/source/others/update.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/source/others/src/update.rst b/docs/source/others/src/update.rst index 84edec8a3..0b62357dc 100644 --- a/docs/source/others/src/update.rst +++ b/docs/source/others/src/update.rst @@ -1,7 +1,7 @@ -2.6.36 ------- +版本更新 +-------- -待发布 +2.6.6 待发布 - disconf-web: diff --git a/docs/source/others/update.md b/docs/source/others/update.md index acef581dd..d4d85b362 100644 --- a/docs/source/others/update.md +++ b/docs/source/others/update.md @@ -1,7 +1,7 @@ -## 2.6.36 +## 版本更新 -待发布 +2.6.6 待发布 - disconf-web: - 配置和配置项可支持自定义app https://github.com/knightliao/disconf/issues/147 From 78dcecb045edae23cb3405a9dbf9da365399e0d5 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 22:03:16 +0800 Subject: [PATCH 13/45] re --- .../common/annotations/DisconfFile.java | 4 +-- .../common/model/DisconfCenterFile.java | 32 ++++++++++--------- .../disconf/client/fetcher/FetcherMgr.java | 4 +-- .../impl/StaticScannerFileMgrImpl.java | 4 +-- .../fetcher/inner/restful/RestfulMgrMock.java | 2 +- .../core/common/restful/RestfulMgr.java | 10 +++--- .../common/restful/impl/RestfulMgrImpl.java | 26 +++++++-------- disconf-web/profile/rd/zoo.properties | 2 +- docs/source/others/update.md | 3 +- .../Tutorial11-config-download-path.md | 22 +++++++++---- 10 files changed, 61 insertions(+), 48 deletions(-) diff --git a/disconf-client/src/main/java/com/baidu/disconf/client/common/annotations/DisconfFile.java b/disconf-client/src/main/java/com/baidu/disconf/client/common/annotations/DisconfFile.java index 99d044f13..d16099872 100644 --- a/disconf-client/src/main/java/com/baidu/disconf/client/common/annotations/DisconfFile.java +++ b/disconf-client/src/main/java/com/baidu/disconf/client/common/annotations/DisconfFile.java @@ -38,10 +38,10 @@ String app() default ""; /** - * 以"/"开头则是系统的全路径,否则则是相对于classpath的路径,默认是classpath根路径 + * 配置文件目标地址dir, 以"/"开头则是系统的全路径,否则则是相对于classpath的路径,默认是classpath根路径 * 注意:根路径要注意是否有权限,否则会出现找不到路径,推荐采用相对路径 * * @return */ - String copy2TargetDirPath() default ""; + String targetDirPath() default ""; } diff --git a/disconf-client/src/main/java/com/baidu/disconf/client/common/model/DisconfCenterFile.java b/disconf-client/src/main/java/com/baidu/disconf/client/common/model/DisconfCenterFile.java index 2d78a983e..64d846bd6 100644 --- a/disconf-client/src/main/java/com/baidu/disconf/client/common/model/DisconfCenterFile.java +++ b/disconf-client/src/main/java/com/baidu/disconf/client/common/model/DisconfCenterFile.java @@ -41,8 +41,8 @@ public class DisconfCenterFile extends DisconfCenterBaseModel { // 文件名 private String fileName; - // 复制到指定的路径下 - private String copy2TargetDirPath; + // 配置文件 指定路径下 + private String targetDirPath; // 文件类型 private SupportFileTypeEnum supportFileTypeEnum = SupportFileTypeEnum.ANY; @@ -95,18 +95,18 @@ public void setIsTaggedWithNonAnnotationFile(boolean isTaggedWithNonAnnotationFi this.isTaggedWithNonAnnotationFile = isTaggedWithNonAnnotationFile; } - public String getCopy2TargetDirPath() { - return copy2TargetDirPath; + public String getTargetDirPath() { + return targetDirPath; } - public void setCopy2TargetDirPath(String copy2TargetDirPath) { - this.copy2TargetDirPath = copy2TargetDirPath; + public void setTargetDirPath(String targetDirPath) { + this.targetDirPath = targetDirPath; } @Override public String toString() { return "\n\tDisconfCenterFile [\n\tkeyMaps=" + keyMaps + "\n\tcls=" + cls + "\n\tfileName=" + fileName - + "\n\tcopy2TargetDirPath=" + copy2TargetDirPath + + + "\n\ttargetDirPath=" + targetDirPath + super.toString() + "]"; } @@ -141,17 +141,19 @@ public Map getKV() { * 配置文件的路径 */ public String getFilePath() { + + // 不放到classpath, 则文件路径根据 userDefineDownloadDir 来设置 if (!DisClientConfig.getInstance().enableLocalDownloadDirInClassPath) { return OsUtil.pathJoin(DisClientConfig.getInstance().userDefineDownloadDir, fileName); } - if (copy2TargetDirPath != null) { + if (targetDirPath != null) { - if (copy2TargetDirPath.startsWith("/")) { - return OsUtil.pathJoin(copy2TargetDirPath, fileName); + if (targetDirPath.startsWith("/")) { + return OsUtil.pathJoin(targetDirPath, fileName); } - return OsUtil.pathJoin(ClassLoaderUtil.getClassPath(), copy2TargetDirPath, fileName); + return OsUtil.pathJoin(ClassLoaderUtil.getClassPath(), targetDirPath, fileName); } return OsUtil.pathJoin(ClassLoaderUtil.getClassPath(), fileName); @@ -163,13 +165,13 @@ public String getFilePath() { public String getFileDir() { // 获取相对于classpath的路径 - if (copy2TargetDirPath != null) { + if (targetDirPath != null) { - if (copy2TargetDirPath.startsWith("/")) { - return OsUtil.pathJoin(copy2TargetDirPath); + if (targetDirPath.startsWith("/")) { + return OsUtil.pathJoin(targetDirPath); } - return OsUtil.pathJoin(ClassLoaderUtil.getClassPath(), copy2TargetDirPath); + return OsUtil.pathJoin(ClassLoaderUtil.getClassPath(), targetDirPath); } return ClassLoaderUtil.getClassPath(); diff --git a/disconf-client/src/main/java/com/baidu/disconf/client/fetcher/FetcherMgr.java b/disconf-client/src/main/java/com/baidu/disconf/client/fetcher/FetcherMgr.java index 46abd6978..195ffabcf 100644 --- a/disconf-client/src/main/java/com/baidu/disconf/client/fetcher/FetcherMgr.java +++ b/disconf-client/src/main/java/com/baidu/disconf/client/fetcher/FetcherMgr.java @@ -14,11 +14,11 @@ public interface FetcherMgr { String getValueFromServer(String url) throws Exception; /** - * 下载配置文件, remoteUrl是目标 url, 下载到预定义的文件夹,并复制到classpath文件夹下 + * 下载配置文件, remoteUrl是目标 url, 下载到预定义的文件夹,并 下载到 targetDirPath 目录下 * * @throws Exception */ - String downloadFileFromServer(String url, String fileName, String copy2TargetDirPath) throws Exception; + String downloadFileFromServer(String url, String fileName, String targetDirPath) throws Exception; /** * 释放资源 diff --git a/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerFileMgrImpl.java b/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerFileMgrImpl.java index 6f9834ec2..f93b4078a 100644 --- a/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerFileMgrImpl.java +++ b/disconf-client/src/main/java/com/baidu/disconf/client/scan/inner/statically/impl/StaticScannerFileMgrImpl.java @@ -96,8 +96,8 @@ private static DisconfCenterFile transformScanFile(Class disconfFileClass, Se // file name disconfCenterFile.setFileName(disconfFileAnnotation.filename()); - // copy 2 target path - disconfCenterFile.setCopy2TargetDirPath(disconfFileAnnotation.copy2TargetDirPath().trim()); + // config file target dir path + disconfCenterFile.setTargetDirPath(disconfFileAnnotation.targetDirPath().trim()); // file type disconfCenterFile.setSupportFileTypeEnum(SupportFileTypeEnum.getByFileName(disconfFileAnnotation.filename())); diff --git a/disconf-client/src/test/java/com/baidu/disconf/client/test/fetcher/inner/restful/RestfulMgrMock.java b/disconf-client/src/test/java/com/baidu/disconf/client/test/fetcher/inner/restful/RestfulMgrMock.java index d2b1aa35f..b67b8c771 100644 --- a/disconf-client/src/test/java/com/baidu/disconf/client/test/fetcher/inner/restful/RestfulMgrMock.java +++ b/disconf-client/src/test/java/com/baidu/disconf/client/test/fetcher/inner/restful/RestfulMgrMock.java @@ -60,7 +60,7 @@ public T getJsonData(Class clazz, RemoteUrl remoteUrl, int retryTimes, in */ @Mock public String downloadFromServer(RemoteUrl remoteUrl, String fileName, String localFileDir, String localFileDirTemp, - String copy2TargetDirPath, boolean download2Classpath, int retryTimes, + String targetDirPath, boolean download2Classpath, int retryTimes, int retrySleepSeconds) throws Exception { diff --git a/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/RestfulMgr.java b/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/RestfulMgr.java index 92ceb91d2..7389dbf75 100644 --- a/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/RestfulMgr.java +++ b/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/RestfulMgr.java @@ -23,17 +23,17 @@ public interface RestfulMgr { T getJsonData(Class clazz, RemoteUrl remoteUrl, int retryTimes, int retrySleepSeconds) throws Exception; /** - * @param remoteUrl 远程地址 - * @param fileName 文件名 - * @param localFileDir 本地文件地址 - * @param copy2TargetDirPath 下载完后,还需要复制到此文件夹下 + * @param remoteUrl 远程地址 + * @param fileName 文件名 + * @param localFileDir 本地文件地址 + * @param targetDirPath 下载完后,配置文件放到此目录下 * * @return 如果是放到Classpath目录下,则返回相对Classpath的路径,如果不是,则返回全路径 * * @throws Exception */ String downloadFromServer(RemoteUrl remoteUrl, String fileName, String localFileDir, String localFileDirTemp, - String copy2TargetDirPath, + String targetDirPath, boolean enableLocalDownloadDirInClassPath, int retryTimes, int retrySleepSeconds) throws Exception; diff --git a/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/impl/RestfulMgrImpl.java b/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/impl/RestfulMgrImpl.java index 63ec929e5..00212dd3a 100644 --- a/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/impl/RestfulMgrImpl.java +++ b/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/impl/RestfulMgrImpl.java @@ -76,10 +76,10 @@ public T getJsonData(Class clazz, RemoteUrl remoteUrl, int retryTimes, in } /** - * @param remoteUrl 远程地址 - * @param fileName 文件名 - * @param localFileDir 本地文件地址 - * @param copy2TargetDirPath 下载完后,还需要复制到此文件夹下 + * @param remoteUrl 远程地址 + * @param fileName 文件名 + * @param localFileDir 本地文件地址 + * @param targetDirPath 下载完后,配置文件指定的文件目录 * @param retryTimes * @param retrySleepSeconds * @@ -89,7 +89,7 @@ public T getJsonData(Class clazz, RemoteUrl remoteUrl, int retryTimes, in */ @Override public String downloadFromServer(RemoteUrl remoteUrl, String fileName, String localFileDir, String localFileDirTemp, - String copy2TargetDirPath, boolean enableLocalDownloadDirInClassPath, + String targetDirPath, boolean enableLocalDownloadDirInClassPath, int retryTimes, int retrySleepSeconds) throws Exception { @@ -110,12 +110,12 @@ public String downloadFromServer(RemoteUrl remoteUrl, String fileName, String lo localFile = transfer2SpecifyDir(tmpFilePathUniqueFile, localFileDir, fileName, false); // mv 到指定目录 - if (copy2TargetDirPath != null) { + if (targetDirPath != null) { // - if (enableLocalDownloadDirInClassPath || !copy2TargetDirPath.equals(ClassLoaderUtil.getClassPath + if (enableLocalDownloadDirInClassPath || !targetDirPath.equals(ClassLoaderUtil.getClassPath ())) { - localFile = transfer2SpecifyDir(tmpFilePathUniqueFile, copy2TargetDirPath, fileName, true); + localFile = transfer2SpecifyDir(tmpFilePathUniqueFile, targetDirPath, fileName, true); } } @@ -129,7 +129,7 @@ public String downloadFromServer(RemoteUrl remoteUrl, String fileName, String lo // // 判断是否下载失败 // - + if (localFile == null || !localFile.exists()) { throw new Exception("target file cannot be found! " + fileName); } @@ -184,20 +184,20 @@ private File retryDownload(String localFileDirTemp, String fileName, RemoteUrl r * copy/mv 到指定目录 * * @param srcFile - * @param copy2TargetDirPath + * @param targetDirPath * @param fileName * * @return * * @throws Exception */ - private File transfer2SpecifyDir(File srcFile, String copy2TargetDirPath, String fileName, + private File transfer2SpecifyDir(File srcFile, String targetDirPath, String fileName, boolean isMove) throws Exception { // make dir - OsUtil.makeDirs(copy2TargetDirPath); + OsUtil.makeDirs(targetDirPath); - File targetPath = new File(OsUtil.pathJoin(copy2TargetDirPath, fileName)); + File targetPath = new File(OsUtil.pathJoin(targetDirPath, fileName)); // 从下载文件 复制/mv 到targetPath 原子性的做转移 OsUtil.transferFileAtom(srcFile, targetPath, isMove); return targetPath; diff --git a/disconf-web/profile/rd/zoo.properties b/disconf-web/profile/rd/zoo.properties index 35b788f27..4ba077c79 100644 --- a/disconf-web/profile/rd/zoo.properties +++ b/disconf-web/profile/rd/zoo.properties @@ -1,5 +1,5 @@ -hosts=10.128.21.89:8581,10.128.21.89:8582,10.128.21.89:8583 +hosts=127.0.0.1:8581,127.0.0.1:8582,127.0.0.1:8583 # zookeeper\u7684\u524D\u7F00\u8DEF\u5F84\u540D zookeeper_url_prefix=/disconf \ No newline at end of file diff --git a/docs/source/others/update.md b/docs/source/others/update.md index d4d85b362..1d3efd06b 100644 --- a/docs/source/others/update.md +++ b/docs/source/others/update.md @@ -8,4 +8,5 @@ - disconf-client: - 支持https的web端 https://github.com/knightliao/disconf/issues/158 - path支持windows: https://github.com/knightliao/disconf/issues/166 - - 删除类 DisconfMgrJustHostFileBean \ No newline at end of file + - 删除类 DisconfMgrJustHostFileBean + - DisconfFile 的属性 copy2TargetDirPath 更改为 targetDirPath \ No newline at end of file diff --git a/docs/source/tutorial-client/Tutorial11-config-download-path.md b/docs/source/tutorial-client/Tutorial11-config-download-path.md index d5601ae16..2d0e866de 100644 --- a/docs/source/tutorial-client/Tutorial11-config-download-path.md +++ b/docs/source/tutorial-client/Tutorial11-config-download-path.md @@ -5,17 +5,27 @@ Tutorial 11 配置文件下载地址讨论 ### 解决:按以下顺序进行判断 -- 一定会下载到 disconf.user_define_download_dir 目录下(使用此方法可以方便的构造一个下载器 [Tutorial10](Tutorial10.html) ) +对于注解式配置文件: + +- 一定会下载到 disconf.user_define_download_dir 目录下(使用此方法可以方便的构造一个下载器. [Tutorial10](Tutorial10.html) ) +- 如果 disconf.enable_local_download_dir_in_class_path 为true(默认值), 则会执行以下判断: + - 如果 @DisconfFile 的 targetDirPath 值不为空, 则会下载到 targetDirPath 这个目录下, 配置数据从该路径读取。这对于那些不想放在classpath根目录的程序, 比较有用. + - 如果 @DisconfFile 的 targetDirPath 值为空, 则会下载到classpath路径下, 配置数据从该路径读取. +- 如果 disconf.enable_local_download_dir_in_class_path 为false, 则不会下载到classpath目录下. 配置数据从 disconf.user_define_download_dir 读取 + +对于XML式配置文件: + +- 一定会下载到 disconf.user_define_download_dir 目录下(使用此方法可以方便的构造一个下载器). - 如果 disconf.enable_local_download_dir_in_class_path 为true(默认值), 则会执行以下判断: - - 如果 @DisconfFile 的 copy2TargetDirPath 值不为空,则会下载这个目录下。(copy2TargetDirPath值说明:以"/"开头则是系统的全路径,否则则是相对于classpath的路径,默认是classpath根路径 - 注意:根路径要注意是否有权限,否则会出现找不到路径,推荐采用相对路径)。这对于那些不想放在classpath根目录的程序,比较有用。 - - 如果 @DisconfFile 的 copy2TargetDirPath 值为空,则会下载到根路径下。大部分程序是从根目录读取配置的,因此,默认是放到根下。 -- 如果 disconf.enable_local_download_dir_in_class_path 为false, 则不会下载到classpath目录下 + - 如果 @DisconfFile 的 targetDirPath 值不为空, 则会下载到 targetDirPath 这个目录下. + - 如果 @DisconfFile 的 targetDirPath 值为空, 则会下载到classpath路径下. +- 如果 disconf.enable_local_download_dir_in_class_path 为false, 则不会下载到classpath目录下. 注: 1. 如果不作任何配置的改变,默认情况下,会下载到 disconf.user_define_download_dir 目录 和 classpath 两个目录下。 -2. 配置说明看这里 [config](../../config/client-config.html) +2. targetDirPath 值说明:以"/"开头则是系统的全路径,否则则是相对于classpath的路径,默认是classpath根路径。注意:根路径要注意是否有权限,否则会出现找不到路径,推荐采用相对路径。 +3. 配置说明看这里 [config](../../config/client-config.html) ### 问题二 不想下载到classpath目录下 From 92f94ad702c417be3c3f1fc55f5e29329ee1acf3 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 22:13:24 +0800 Subject: [PATCH 14/45] re --- docs/source/tutorial-client/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/tutorial-client/index.rst b/docs/source/tutorial-client/index.rst index 98f765320..c7a027487 100644 --- a/docs/source/tutorial-client/index.rst +++ b/docs/source/tutorial-client/index.rst @@ -16,6 +16,6 @@ Tutorial-client src/Tutorial10 src/Tutorial11-config-download-path src/Tutorial13-unify-notify - src/Tutorial14-bean-setter-mode.md + src/Tutorial14-bean-setter-mode src/jar-start-up - src/config-getter \ No newline at end of file + src/config-getter From e99a4363b3776341bf9df8c2c273d463e551bad0 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 22:42:19 +0800 Subject: [PATCH 15/45] re --- docs/source/others/contribute.md | 6 +++- docs/source/others/src/contribute.rst | 9 +++-- docs/source/others/src/update.rst | 1 + .../src/Tutorial11-config-download-path.rst | 35 +++++++++++++++---- 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/docs/source/others/contribute.md b/docs/source/others/contribute.md index 875005569..0210134fc 100644 --- a/docs/source/others/contribute.md +++ b/docs/source/others/contribute.md @@ -1,10 +1,14 @@ 社区贡献 ======= -## 其他disconf-web开源 +## 其他disconf-web开源实现 - https://github.com/comlkz/disconf-web +## 其他disconf-client开源实现 + +- Node: https://github.com/Corey600/node-disconf-client + ## 网友贡献/使用教程 - [cnblog: 马进举 统一配置管理-百度disconf ](http://www.cnblogs.com/majinju/p/4502246.html) diff --git a/docs/source/others/src/contribute.rst b/docs/source/others/src/contribute.rst index 17f556e98..5033dcd14 100644 --- a/docs/source/others/src/contribute.rst +++ b/docs/source/others/src/contribute.rst @@ -1,11 +1,16 @@ 社区贡献 ======== -其他disconf-web开源 -------------------- +其他disconf-web开源实现 +----------------------- - https://github.com/comlkz/disconf-web +其他disconf-client开源实现 +-------------------------- + +- Node: https://github.com/Corey600/node-disconf-client + 网友贡献/使用教程 ----------------- diff --git a/docs/source/others/src/update.rst b/docs/source/others/src/update.rst index 0b62357dc..36d042aad 100644 --- a/docs/source/others/src/update.rst +++ b/docs/source/others/src/update.rst @@ -13,3 +13,4 @@ - 支持https的web端 https://github.com/knightliao/disconf/issues/158 - path支持windows: https://github.com/knightliao/disconf/issues/166 - 删除类 DisconfMgrJustHostFileBean + - DisconfFile 的属性 copy2TargetDirPath 更改为 targetDirPath diff --git a/docs/source/tutorial-client/src/Tutorial11-config-download-path.rst b/docs/source/tutorial-client/src/Tutorial11-config-download-path.rst index c836f01fe..5e9e7b540 100644 --- a/docs/source/tutorial-client/src/Tutorial11-config-download-path.rst +++ b/docs/source/tutorial-client/src/Tutorial11-config-download-path.rst @@ -7,25 +7,46 @@ Tutorial 11 配置文件下载地址讨论 解决:按以下顺序进行判断 ~~~~~~~~~~~~~~~~~~~~~~~~ +对于注解式配置文件: + - 一定会下载到 disconf.user\_define\_download\_dir - 目录下(使用此方法可以方便的构造一个下载器 + 目录下(使用此方法可以方便的构造一个下载器. `Tutorial10 `__ ) - 如果 disconf.enable\_local\_download\_dir\_in\_class\_path 为true(默认值), 则会执行以下判断: - - 如果 @DisconfFile 的 copy2TargetDirPath - 值不为空,则会下载这个目录下。(copy2TargetDirPath值说明:以"/"开头则是系统的全路径,否则则是相对于classpath的路径,默认是classpath根路径 - 注意:根路径要注意是否有权限,否则会出现找不到路径,推荐采用相对路径)。这对于那些不想放在classpath根目录的程序,比较有用。 - - 如果 @DisconfFile 的 copy2TargetDirPath - 值为空,则会下载到根路径下。大部分程序是从根目录读取配置的,因此,默认是放到根下。 + - 如果 @DisconfFile 的 targetDirPath 值不为空, 则会下载到 + targetDirPath 这个目录下, + 配置数据从该路径读取。这对于那些不想放在classpath根目录的程序, + 比较有用. + - 如果 @DisconfFile 的 targetDirPath 值为空, + 则会下载到classpath路径下, 配置数据从该路径读取. + +- 如果 disconf.enable\_local\_download\_dir\_in\_class\_path 为false, + 则不会下载到classpath目录下. 配置数据从 + disconf.user\_define\_download\_dir 读取 + +对于XML式配置文件: + +- 一定会下载到 disconf.user\_define\_download\_dir + 目录下(使用此方法可以方便的构造一个下载器). +- 如果 disconf.enable\_local\_download\_dir\_in\_class\_path + 为true(默认值), 则会执行以下判断: + + - 如果 @DisconfFile 的 targetDirPath 值不为空, 则会下载到 + targetDirPath 这个目录下. + - 如果 @DisconfFile 的 targetDirPath 值为空, + 则会下载到classpath路径下. - 如果 disconf.enable\_local\_download\_dir\_in\_class\_path 为false, - 则不会下载到classpath目录下 + 则不会下载到classpath目录下. 注: #. 如果不作任何配置的改变,默认情况下,会下载到 disconf.user\_define\_download\_dir 目录 和 classpath 两个目录下。 +#. targetDirPath + 值说明:以"/"开头则是系统的全路径,否则则是相对于classpath的路径,默认是classpath根路径。注意:根路径要注意是否有权限,否则会出现找不到路径,推荐采用相对路径。 #. 配置说明看这里 `config <../../config/client-config.html>`__ 问题二 不想下载到classpath目录下 From 923626a9629596747f92ffdfc1a887a398ab55f7 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 23:00:46 +0800 Subject: [PATCH 16/45] re --- README.md | 2 +- disconf-client/pom.xml | 2 +- disconf-core/pom.xml | 2 +- disconf-web/pom.xml | 2 +- pom.xml | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 60add3cdc..78b605fce 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Distributed Configuration Management Platform(分布式配置管理平台) ## 版本 -- dev(latest branch): 2.6.36-SNAPSHOT +- dev(latest branch): 2.6.36 - master(cooperate && contribute branch):2.6.35 - stable(release && stable branch): 2.6.35 - 在Maven Central Repository里查看 [com.baidu.disconf](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.baidu.disconf%22 ) diff --git a/disconf-client/pom.xml b/disconf-client/pom.xml index 193b3e8ad..524931042 100644 --- a/disconf-client/pom.xml +++ b/disconf-client/pom.xml @@ -10,7 +10,7 @@ com.baidu.disconf disconf-base - 2.6.36-SNAPSHOT + 2.6.36 diff --git a/disconf-core/pom.xml b/disconf-core/pom.xml index 6df47a981..39145c935 100644 --- a/disconf-core/pom.xml +++ b/disconf-core/pom.xml @@ -13,7 +13,7 @@ com.baidu.disconf disconf-base - 2.6.36-SNAPSHOT + 2.6.36 diff --git a/disconf-web/pom.xml b/disconf-web/pom.xml index 74a51b835..c6628aab5 100644 --- a/disconf-web/pom.xml +++ b/disconf-web/pom.xml @@ -12,7 +12,7 @@ com.baidu.disconf disconf-base - 2.6.36-SNAPSHOT + 2.6.36 diff --git a/pom.xml b/pom.xml index 0242dadf5..04dcbd427 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.baidu.disconf disconf-base - 2.6.36-SNAPSHOT + 2.6.36 pom @@ -25,9 +25,9 @@ - 2.6.36-SNAPSHOT - 2.6.36-SNAPSHOT - 2.6.36-SNAPSHOT + 2.6.36 + 2.6.36 + 2.6.36 UTF-8 From 08d032a5a25771b6a8c1f82fde0dea364ed0e315 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 23:06:53 +0800 Subject: [PATCH 17/45] re --- docs/source/others/src/update.rst | 2 +- docs/source/others/update.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/others/src/update.rst b/docs/source/others/src/update.rst index 36d042aad..f83b1c5f3 100644 --- a/docs/source/others/src/update.rst +++ b/docs/source/others/src/update.rst @@ -1,7 +1,7 @@ 版本更新 -------- -2.6.6 待发布 +2.6.6 发布于 20160911 - disconf-web: diff --git a/docs/source/others/update.md b/docs/source/others/update.md index 1d3efd06b..f52777149 100644 --- a/docs/source/others/update.md +++ b/docs/source/others/update.md @@ -1,7 +1,7 @@ ## 版本更新 -2.6.6 待发布 +2.6.6 发布于 20160911 - disconf-web: - 配置和配置项可支持自定义app https://github.com/knightliao/disconf/issues/147 From b64299aa2b01f01c13760e1c166304380fc83ca0 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 23:50:29 +0800 Subject: [PATCH 18/45] re --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 78b605fce..89954991f 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Distributed Configuration Management Platform(分布式配置管理平台) ## 版本 - dev(latest branch): 2.6.36 -- master(cooperate && contribute branch):2.6.35 +- master(cooperate && contribute branch):2.6.36 - stable(release && stable branch): 2.6.35 - 在Maven Central Repository里查看 [com.baidu.disconf](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.baidu.disconf%22 ) From 68d4a82758a42fd6fb0c4b4a0aeb2e1a0be2b6f5 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 23:51:02 +0800 Subject: [PATCH 19/45] re --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 89954991f..c69347db6 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ Distributed Configuration Management Platform(分布式配置管理平台) ## 版本 -- dev(latest branch): 2.6.36 -- master(cooperate && contribute branch):2.6.36 +- dev(dev branch): 2.6.36 +- master(latest && cooperate && contribute branch):2.6.36 - stable(release && stable branch): 2.6.35 - 在Maven Central Repository里查看 [com.baidu.disconf](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.baidu.disconf%22 ) From 6916d1815526416f9ced477c2e20ff14837da157 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 23:51:42 +0800 Subject: [PATCH 20/45] re --- docs/source/install/01.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/install/01.md b/docs/source/install/01.md index d92d63f50..aedd680fa 100644 --- a/docs/source/install/01.md +++ b/docs/source/install/01.md @@ -5,5 +5,5 @@ com.baidu.disconf disconf-client - 2.6.35 + 2.6.36 \ No newline at end of file From b28470b14ca90de4b806782a67ac3a986dc69b8b Mon Sep 17 00:00:00 2001 From: knightliao Date: Sun, 11 Sep 2016 23:52:06 +0800 Subject: [PATCH 21/45] re --- docs/source/install/src/01.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/install/src/01.rst b/docs/source/install/src/01.rst index 01e96de2d..c6331d4a4 100644 --- a/docs/source/install/src/01.rst +++ b/docs/source/install/src/01.rst @@ -8,5 +8,5 @@ disconf-client Install com.baidu.disconf disconf-client - 2.6.35 + 2.6.36 From 3efc5ab91bae538dbf0eac71175dc4168d11807d Mon Sep 17 00:00:00 2001 From: knightliao Date: Mon, 12 Sep 2016 00:03:13 +0800 Subject: [PATCH 22/45] re --- docs/source/others/src/update.rst | 422 ++++++++++++++++++++++++++++++ docs/source/others/update.md | 280 +++++++++++++++++++- 2 files changed, 701 insertions(+), 1 deletion(-) diff --git a/docs/source/others/src/update.rst b/docs/source/others/src/update.rst index f83b1c5f3..8f5a53c90 100644 --- a/docs/source/others/src/update.rst +++ b/docs/source/others/src/update.rst @@ -14,3 +14,425 @@ - path支持windows: https://github.com/knightliao/disconf/issues/166 - 删除类 DisconfMgrJustHostFileBean - DisconfFile 的属性 copy2TargetDirPath 更改为 targetDirPath + +2.6.35 +------ + +2016年7月1号 + +- disconf-client: + + - fix bug: support bean annotation @Value (但是不支持reload特性) + - fix bug: + 当同时使用XML式和注解式时,当修改配置时,XML式的BEAN也可以重新被注入 + https://github.com/knightliao/disconf/issues/70 + +- disconf-web: + + - 支持自定义数据库名 + + - 需要修改 jdbc-mysql.properties : + + - 以前是:jdbc.db\_0.url=jdbc:mysql://127.0.0.1:3306?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=false + - 现在是 + jdbc.db\_0.url=jdbc:mysql://127.0.0.1:3306/disconf?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull + &rewriteBatchedStatements=false + + - 提供修改密码功能 + + - 需要执行 disconf-web/sql/20160701/20160701.sql + + - 提供生成密码的工具 + + - /disconf-web/bin/sql/makeSql.py + + - 支持client两个api + + - /api/config/list 可以自由的 指定app env version + 的配置项列表(包含值) + - /api/config/simple/list 可以自由的 指定app env version + 的配置项列表(不包含值) + +2.6.34 +------ + +2016年5月31号 + +- disconf-client: + + - 删除临时创建的lock文件 + + - https://github.com/knightliao/disconf/issues/79 + + - 支持从自定义路径读取 disconf.properties + + - 例如使用 -Ddisconf.conf=/tmp/disconf.properties 来读取 + disconf.properties 文件。默认是从classpath根目录读取此文件。 + + - issue: https://github.com/knightliao/disconf/issues/93 + - 说明: + hhttp://disconf.readthedocs.io/zh\_CN/stable/config/src/client-config.html#disconf-client + + - 增加统一的类 来个性化编程式的获取任何配置数据 + + - issue: https://github.com/knightliao/disconf/issues/94 + - 说明: + http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/config-getter.html + + - fix bug: + + - 使用xml分布式配置时,当disconf.ignore掉某个配置文件时,启动后会抛异常说该配置文件找不到。修复后不会再报错 + - 新增配置项,值可以为空格,修改该配置项,就算改为有效字符,都会提示“服务器内部错误” + + - https://github.com/knightliao/disconf/issues/77 + + - java.lang.IllegalArgumentException: wrong number of arguments + + - https://github.com/knightliao/disconf/issues/89 + + - upgrade common-lang -> common-lang3 + + - https://github.com/knightliao/disconf/issues/81 + +- disconf-web: + + - 删除web的jackson依赖 + + - https://github.com/knightliao/disconf/issues/82 + + - upgrade common-lang -> common-lang3 + + - https://github.com/knightliao/disconf/issues/81 + +2.6.33 +------ + +2016月5月07日 + +- disconf-client: + + - (随着以-jar方式启动的程序变得越来越流行)当使用以-jar方式启动的程序(非tomcat,web方式)时,例如springboot时,可以无缝对接(不会出现配置文件找不到的情况)。 + + - 说明: + http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/jar-start-up.html + +2.6.32 +------ + +2016月3月27日 + +- disconf-client: + + - 增加统一的回调类,unify-notify模式:灵活处理更新配置通知(方便大家在这里自由控制更新逻辑)\ `issue-67 `__ + `Tutorial-13 `__ + - 配置初始化或更新时,通知采用 "bean setter模式": + 在注入配置到实例时,优先使用set方法(方便大家在这里写自己逻辑代码),其次才是反射注入。 + `Tutorial-14 `__ + +2.6.31 +------ + +发布于:2016月1月8日 + +- disconf-client: + + - 精减库依赖,去掉使用jersey库,避免库冲突: 改采用简单的httpclient下载 + +- disconf-web: + + - 支持历史操作记录第一期,支持数据库记录。 + + - 需要更新SQL: + https://github.com/knightliao/disconf/blob/master/disconf-web/sql/201512/20151225.sql + +2.6.30 +------ + +发布于:2015年12月1日 + +- disconf-client: + + - 不再需要将\ ``com.baidu``\ 加入扫描包了,只需要扫描自己的包即可。 + + 原来的方式 + + :: + + + + 现在的 + + :: + + + +2.6.29 +------ + +存在BUG,已废弃 + +2.6.28 +------ + +发布于:2015年11月20日 + +- disconf-client: + + - 每个配置文件的路径支持个性化指定,不一定非是classpath + + - http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial11-config-download-path.html + + - 支持spring-boot jar包识别方式 + 参见:\ https://github.com/knightliao/disconf-demos-java/tree/master/disconf-spring-boot-demo + - 修复bug: + + - 在高于spring-bean3.1.2版本中出现基于XML配置的配置文件无法reload + + - 使 disconf.enable\_local\_download\_dir\_in\_class\_path + 该配置用户可以自行配置: + + - http://disconf.readthedocs.io/zh_CN/stable/config/src/client-config.html + +- 精减依赖项 + +2.6.27 +------ + +发布于:2015年10月26日 + +- disconf-client: + + - fix bean order 问题 + +- disconf-web: + + - fix 上传文件(使用贴文本方式)的version无法指定的bug + +2.6.26 +------ + +发布于:2015年10月26日 + +- disconf-client: + + - 实现真正意义上的统一上线包:disconf-client 配置文件 + disconf.properties 的 所有配置项均支持环境变量方式(命令行)传入 + 均支持 + + - 说明:\ `配置说明 `__ + - `Tutorial 9 + 实现真正意义上的统一上线包 `__ + + - (重要)更新disconf.properties中所有配置项,均加上前缀 + "disconf."(此升级具有兼容性,原有配置亦可以运行,但推荐升级) + + - 说明: + `配置说明 `__ + +- disconf-web: + + - 新建配置时 app下拉页面被截断bug修复 + https://github.com/knightliao/disconf/issues/22 + +2.6.25 +------ + +发布于:2015年8月20日 + +- disconf-client: + + - 实现真正意义上的统一上线包:disconf-client 配置文件 + disconf.properties 的 app,env,version 均支持 + 环境变量方式(命令行)参数传入方式 + + - 说明: + `配置说明 `__ + - `Tutorial 9 + 实现真正意义上的统一上线包 `__ + + - disconf.properties支持 user\_define\_download\_dir + 项目,用户可以指定将配置下载到你想要的目录 + + - 说明: + `配置说明 `__ + - `Tutorial 10 + 实现一个配置更新下载器agent `__ + + - fix bugs + +- disconf-demos + + - `disconf-spring-boot-demo `__: + 使用disconf的spring-boot demo程序,更少的配置 + +2.6.24 +------ + +发布于:2015年7月3日 + +- disconf-client: + + - fix bug https://github.com/knightliao/disconf/issues/11 + +2.6.23 +------ + +发布于:2015年7月2日 + +- disconf-client: + + - 增加功能:scanPackage 增加扫描多包功能,逗号分隔,例如: + + :: + + + + + +2.6.22 +------ + +发布于:2015年6月3日 + +- disconf-client: + + - fix bug: + 当enable.remote.conf为false时,disconf-client可能无法读取本地配置的问题 + +2.6.21 +------ + +发布于:2015年4月14日 + +- disconf-client: + + - 其它小修改 + - 优化 pom.xml + +2.6.20 +------ + +发布于:2015年3月27日 + +- disconf-client: + + - `支持基于XML配置的,无任何代码侵入的 + 分布式配置 `__ + +2.6.19 +------ + +发布于:2015年1月22日 + +- disconf-client: + + - `支持任意文件的配置托管 `__ + - `回调时支持以配置key作为key `__ + +- disconf-web: + + - 支持角色系统【普通,管理员,只读管理员】 + - 当配置文件里面含有unicode时,支持显示成UTF8 + +2.6.18 +------ + +发布于:2014年12月19日 + +- disconf-client: + + - FIX BUG: + 同一台机器多个实例使用同一个classpath下的并发设置配置文件BUG(非常重要) + - FIX BUG: disconf store use 'get' (非常重要) + +2.6.16 +------ + +发布于:2014年12月3日 + +- disconf-client: + + - fix zookeeper session expired error: + 当ZK集群不可用时,disconf-client可以自动重连,并保证配置watch信息不丢失。 + +- disconf-web: + + - `主页配置获取、ZK监控情况改成ajax请求(为了避免主页载入数据太多) `__ + - `支持新建、修改任何配置时发送邮件通知 `__ + - `支持多用户对多APP的权限控制 `__ + - `支持定时校验中心的配置 和 + 多客户端配置的一致性 `__ + +2.6.15 +------ + +发布于:2014年11月7日 + +- disconf-client: + + - `非注解式(托管式)的配置文件添加,增加额外的定义方式。原有的方式(2.6.14版本)的方式亦兼容,但不推荐使用。 `__ + - `非注解式(托管式)的配置文件额外支持xml(以前仅支持properties)格式。 `__ + +2.6.14 +------ + +发布于:2014年9月18日 + +- disconf-client: + + - `支持非注解方式(托管式)的配置文件统一化(只支持.propertes格式) `__ + - fix bug: 静态配置文件无法动态更新的BUG + - ZK session expire time enlarge from 5 to 30 seconds + - `支持自定义过滤分布式配置 `__ + +- disconf-web: 支持更便捷人性化的ZK查询 + + - 配置文件的输入支持 直接文本输入+上传配置文件方式 + - 支持配置文件下载,批量下载 + - 支持显示配置所影响的机器源,并提供配置数据校验工具 + - 全新Web主页 + +2.6.13 +------ + +发布于:2014年9月4日 + +- fix bug: 配置里解析Integer(或类似非String)数据时出错 +- Zoo Preifix: client get this value from server, not from local config +- fix bug: + disconf不是最高优先级启动,导致在本地没有配置文件时,PropertyPlaceholderConfigurer在Disconf启动前初始化, + location为空,因此它认为没有配置文件存在,出现Spring启动失败。 + 修改方法是,使用BeanDefinitionRegistryPostProcessor使Disconf最高优先级启动,这样后面执行PropertyPlaceholderConfigurer初始化 + 时就可以发现所有的配置文件。 + +2.6.11 & 2.6.12 +--------------- + +- 修复BUG: 当不使用Disconf时,close会有Null异常 +- 打日志策略更新:原则上日志为Debug,出错为ERROR,需要注意为WARN + +2.6.10 +------ + +- change log: + + - 注入静态配置域时不再打印错误字段 + - 配置完成后打印配置仓库时打印方式pretty化 + +- 修复BUG: + 支持空配置文件类,如EmptyConf.java,可以使用它来实现简单的同步 + +2.6.9 +----- + +- FixBug:找不到 disconf\_sys.properties +- 增加功能: + + - 支持静态配置文件分布式 + - 支持配置配置项分布式 + +2.6.8 +----- + +- Init Version diff --git a/docs/source/others/update.md b/docs/source/others/update.md index f52777149..ad70113f0 100644 --- a/docs/source/others/update.md +++ b/docs/source/others/update.md @@ -9,4 +9,282 @@ - 支持https的web端 https://github.com/knightliao/disconf/issues/158 - path支持windows: https://github.com/knightliao/disconf/issues/166 - 删除类 DisconfMgrJustHostFileBean - - DisconfFile 的属性 copy2TargetDirPath 更改为 targetDirPath \ No newline at end of file + - DisconfFile 的属性 copy2TargetDirPath 更改为 targetDirPath + + +## 2.6.35 ## + +2016年7月1号 + +- disconf-client: + - fix bug: support bean annotation @Value (但是不支持reload特性) + - fix bug: 当同时使用XML式和注解式时,当修改配置时,XML式的BEAN也可以重新被注入 https://github.com/knightliao/disconf/issues/70 +- disconf-web: + - 支持自定义数据库名 + - 需要修改 jdbc-mysql.properties : + - 以前是:jdbc.db_0.url=jdbc:mysql://127.0.0.1:3306?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=false + - 现在是 jdbc.db_0.url=jdbc:mysql://127.0.0.1:3306/disconf?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull + &rewriteBatchedStatements=false + - 提供修改密码功能 + - 需要执行 disconf-web/sql/20160701/20160701.sql + - 提供生成密码的工具 + - /disconf-web/bin/sql/makeSql.py + - 支持client两个api + - /api/config/list 可以自由的 指定app env version 的配置项列表(包含值) + - /api/config/simple/list 可以自由的 指定app env version 的配置项列表(不包含值) + +## 2.6.34 ## + +2016年5月31号 + +- disconf-client: + - 删除临时创建的lock文件 + - https://github.com/knightliao/disconf/issues/79 + - 支持从自定义路径读取 disconf.properties + - 例如使用 -Ddisconf.conf=/tmp/disconf.properties 来读取 disconf.properties 文件。默认是从classpath根目录读取此文件。 + - issue: https://github.com/knightliao/disconf/issues/93 + - 说明: hhttp://disconf.readthedocs.io/zh_CN/stable/config/src/client-config.html#disconf-client + - 增加统一的类 来个性化编程式的获取任何配置数据 + - issue: https://github.com/knightliao/disconf/issues/94 + - 说明: http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/config-getter.html + - fix bug: + - 使用xml分布式配置时,当disconf.ignore掉某个配置文件时,启动后会抛异常说该配置文件找不到。修复后不会再报错 + - 新增配置项,值可以为空格,修改该配置项,就算改为有效字符,都会提示“服务器内部错误” + - https://github.com/knightliao/disconf/issues/77 + - java.lang.IllegalArgumentException: wrong number of arguments + - https://github.com/knightliao/disconf/issues/89 + - upgrade common-lang -> common-lang3 + - https://github.com/knightliao/disconf/issues/81 +- disconf-web: + - 删除web的jackson依赖 + - https://github.com/knightliao/disconf/issues/82 + - upgrade common-lang -> common-lang3 + - https://github.com/knightliao/disconf/issues/81 + +## 2.6.33 ## + +2016月5月07日 + +- disconf-client: + - (随着以-jar方式启动的程序变得越来越流行)当使用以-jar方式启动的程序(非tomcat,web方式)时,例如springboot时,可以无缝对接(不会出现配置文件找不到的情况)。 + - 说明: http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/jar-start-up.html + +## 2.6.32 ## + +2016月3月27日 + +- disconf-client: + - 增加统一的回调类,unify-notify模式:灵活处理更新配置通知(方便大家在这里自由控制更新逻辑)[issue-67](https://github.com/knightliao/disconf/issues/67) + [Tutorial-13](http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial13-unify-notify.html) + - 配置初始化或更新时,通知采用 "bean setter模式": 在注入配置到实例时,优先使用set方法(方便大家在这里写自己逻辑代码),其次才是反射注入。 + [Tutorial-14](http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial14-bean-setter-mode.html) + +## 2.6.31 ## + +发布于:2016月1月8日 + +- disconf-client: + - 精减库依赖,去掉使用jersey库,避免库冲突: 改采用简单的httpclient下载 +- disconf-web: + - 支持历史操作记录第一期,支持数据库记录。 + - 需要更新SQL: https://github.com/knightliao/disconf/blob/master/disconf-web/sql/201512/20151225.sql + +## 2.6.30 ## + +发布于:2015年12月1日 + +- disconf-client: + - 不再需要将`com.baidu`加入扫描包了,只需要扫描自己的包即可。 + + 原来的方式 + + + + 现在的 + + + +## 2.6.29 ## + +存在BUG,已废弃 + +## 2.6.28 ## + +发布于:2015年11月20日 + +- disconf-client: + - 每个配置文件的路径支持个性化指定,不一定非是classpath + - http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial11-config-download-path.html + - 支持spring-boot jar包识别方式 参见:https://github.com/knightliao/disconf-demos-java/tree/master/disconf-spring-boot-demo + - 修复bug: + - 在高于spring-bean3.1.2版本中出现基于XML配置的配置文件无法reload + - 使 disconf.enable_local_download_dir_in_class_path 该配置用户可以自行配置: + - http://disconf.readthedocs.io/zh_CN/stable/config/src/client-config.html +- 精减依赖项 + +## 2.6.27 ## + +发布于:2015年10月26日 + +- disconf-client: + - fix bean order 问题 +- disconf-web: + - fix 上传文件(使用贴文本方式)的version无法指定的bug + +## 2.6.26 ## + +发布于:2015年10月26日 + +- disconf-client: + - 实现真正意义上的统一上线包:disconf-client 配置文件 disconf.properties 的 所有配置项均支持环境变量方式(命令行)传入 均支持 + - 说明:[配置说明](http://disconf.readthedocs.io/zh_CN/stable/config/src/client-config.html) + - [Tutorial 9 实现真正意义上的统一上线包](http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial9.html) + - (重要)更新disconf.properties中所有配置项,均加上前缀 "disconf."(此升级具有兼容性,原有配置亦可以运行,但推荐升级) + - 说明: [配置说明](http://disconf.readthedocs.io/zh_CN/stable/config/src/client-config.html) +- disconf-web: + - 新建配置时 app下拉页面被截断bug修复 https://github.com/knightliao/disconf/issues/22 + +## 2.6.25 ## + +发布于:2015年8月20日 + +- disconf-client: + - 实现真正意义上的统一上线包:disconf-client 配置文件 disconf.properties 的 app,env,version 均支持 环境变量方式(命令行)参数传入方式 + - 说明: [配置说明](http://disconf.readthedocs.io/zh_CN/stable/config/src/client-config.html) + - [Tutorial 9 实现真正意义上的统一上线包](http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial9.html) + - disconf.properties支持 user_define_download_dir 项目,用户可以指定将配置下载到你想要的目录 + - 说明: [配置说明](http://disconf.readthedocs.io/zh_CN/stable/config/src/client-config.html) + - [Tutorial 10 实现一个配置更新下载器agent](http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial10.html) + - fix bugs +- disconf-demos + - [disconf-spring-boot-demo](https://github + .com/knightliao/disconf/tree/dev/disconf-demos/disconf-spring-boot-demo): 使用disconf的spring-boot demo程序,更少的配置 + +## 2.6.24 ## + +发布于:2015年7月3日 + +- disconf-client: + - fix bug https://github.com/knightliao/disconf/issues/11 + +## 2.6.23 ## + +发布于:2015年7月2日 + +- disconf-client: + - 增加功能:scanPackage 增加扫描多包功能,逗号分隔,例如: + + + + + +## 2.6.22 ## + +发布于:2015年6月3日 + +- disconf-client: + - fix bug: 当enable.remote.conf为false时,disconf-client可能无法读取本地配置的问题 + +## 2.6.21 ## + +发布于:2015年4月14日 + +- disconf-client: + - 其它小修改 + - 优化 pom.xml + +## 2.6.20 ## + +发布于:2015年3月27日 + +- disconf-client: + - [支持基于XML配置的,无任何代码侵入的 分布式配置](http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial8.html) + +## 2.6.19 ## + +发布于:2015年1月22日 + +- disconf-client: + - [支持任意文件的配置托管](http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial5.html) + - [回调时支持以配置key作为key](http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial2.html) +- disconf-web: + - 支持角色系统【普通,管理员,只读管理员】 + - 当配置文件里面含有unicode时,支持显示成UTF8 + +## 2.6.18 ## + +发布于:2014年12月19日 + +- disconf-client: + - FIX BUG: 同一台机器多个实例使用同一个classpath下的并发设置配置文件BUG(非常重要) + - FIX BUG: disconf store use 'get' (非常重要) + +## 2.6.16 ## + +发布于:2014年12月3日 + +- disconf-client: + - fix zookeeper session expired error: 当ZK集群不可用时,disconf-client可以自动重连,并保证配置watch信息不丢失。 +- disconf-web: + - [主页配置获取、ZK监控情况改成ajax请求(为了避免主页载入数据太多)](http://disconf.readthedocs.io/zh_CN/stable/tutorial-web/src/Tutorial6.html) + - [支持新建、修改任何配置时发送邮件通知](hhttp://disconf.readthedocs.io/zh_CN/stable/tutorial-web/src/Tutorial6.html) + - [支持多用户对多APP的权限控制](http://disconf.readthedocs.io/zh_CN/stable/tutorial-web/src/Tutorial6.html) + - [支持定时校验中心的配置 和 多客户端配置的一致性](http://disconf.readthedocs.io/zh_CN/stable/tutorial-web/src/Tutorial6.html) + +## 2.6.15 ## + +发布于:2014年11月7日 + +- disconf-client: + - [非注解式(托管式)的配置文件添加,增加额外的定义方式。原有的方式(2.6.14版本)的方式亦兼容,但不推荐使用。](http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial5.html) + - [非注解式(托管式)的配置文件额外支持xml(以前仅支持properties)格式。](http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial5.html) + +## 2.6.14 ## + +发布于:2014年9月18日 + +- disconf-client: + - [支持非注解方式(托管式)的配置文件统一化(只支持.propertes格式)](http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial5.html) + - fix bug: 静态配置文件无法动态更新的BUG + - ZK session expire time enlarge from 5 to 30 seconds + - [支持自定义过滤分布式配置](http://disconf.readthedocs.io/zh_CN/stable/tutorial-client/src/Tutorial7.html) +- disconf-web: 支持更便捷人性化的ZK查询 + - 配置文件的输入支持 直接文本输入+上传配置文件方式 + - 支持配置文件下载,批量下载 + - 支持显示配置所影响的机器源,并提供配置数据校验工具 + - 全新Web主页 + +## 2.6.13 ## + +发布于:2014年9月4日 + +- fix bug: 配置里解析Integer(或类似非String)数据时出错 +- Zoo Preifix: client get this value from server, not from local config +- fix bug: disconf不是最高优先级启动,导致在本地没有配置文件时,PropertyPlaceholderConfigurer在Disconf启动前初始化, +location为空,因此它认为没有配置文件存在,出现Spring启动失败。 +修改方法是,使用BeanDefinitionRegistryPostProcessor使Disconf最高优先级启动,这样后面执行PropertyPlaceholderConfigurer初始化 +时就可以发现所有的配置文件。 + +## 2.6.11 & 2.6.12 ## + +- 修复BUG: 当不使用Disconf时,close会有Null异常 +- 打日志策略更新:原则上日志为Debug,出错为ERROR,需要注意为WARN + +## 2.6.10 ## + +- change log: + - 注入静态配置域时不再打印错误字段 + - 配置完成后打印配置仓库时打印方式pretty化 +- 修复BUG: 支持空配置文件类,如EmptyConf.java,可以使用它来实现简单的同步 + +## 2.6.9 ## + +- FixBug:找不到 disconf_sys.properties +- 增加功能: + - 支持静态配置文件分布式 + - 支持配置配置项分布式 + +## 2.6.8 ## + +- Init Version \ No newline at end of file From f52fc87a56969d8365b17cab3f896d616ac6c1b8 Mon Sep 17 00:00:00 2001 From: knightliao Date: Mon, 12 Sep 2016 17:56:42 +0800 Subject: [PATCH 23/45] re --- docs/source/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index aab6ac42e..cc2d25c9f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -57,9 +57,9 @@ # built documents. # # The short X.Y version. -version = u'2.6.35' +version = u'2.6.36' # The full version, including alpha/beta/rc tags. -release = u'2.6.35' +release = u'2.6.36' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From b15612006e5444daa536c1a67e084efb71324aca Mon Sep 17 00:00:00 2001 From: knightliao Date: Mon, 19 Sep 2016 17:38:35 +0800 Subject: [PATCH 24/45] re --- docs/source/tutorial-client/Tutorial9.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/tutorial-client/Tutorial9.md b/docs/source/tutorial-client/Tutorial9.md index 90befdf6f..0c2a2d475 100644 --- a/docs/source/tutorial-client/Tutorial9.md +++ b/docs/source/tutorial-client/Tutorial9.md @@ -15,7 +15,7 @@ Tutorial 9 实现真正意义上的统一上线包 目前 disconf 已经支持 `disconf.properties` 中所有配置项 通过参数传入方式 启动。 -支持的配置项具体可参见: [link](../../config/client-config.html) +支持的配置项具体可参见: [link](../../config/src/client-config.html) 这样的话,未来大家只要通过 Java 参数 就可以 动态的改变启动的 app/env/version From c3f5b93059e466af1ea19e18f05276671b1f82e1 Mon Sep 17 00:00:00 2001 From: knightliao Date: Mon, 19 Sep 2016 17:45:49 +0800 Subject: [PATCH 25/45] re --- docs/source/tutorial-client/src/Tutorial9.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/tutorial-client/src/Tutorial9.rst b/docs/source/tutorial-client/src/Tutorial9.rst index db8c23d69..8936a3fcf 100644 --- a/docs/source/tutorial-client/src/Tutorial9.rst +++ b/docs/source/tutorial-client/src/Tutorial9.rst @@ -21,7 +21,7 @@ Tutorial 9 实现真正意义上的统一上线包 目前 disconf 已经支持 ``disconf.properties`` 中所有配置项 通过参数传入方式 启动。 -支持的配置项具体可参见: `link <../../config/client-config.html>`__ +支持的配置项具体可参见: `link <../../config/src/client-config.html>`__ 这样的话,未来大家只要通过 Java 参数 就可以 动态的改变启动的 app/env/version From 651e2e4c4ca24c24ffbc4dab13bf60be31554775 Mon Sep 17 00:00:00 2001 From: knightliao Date: Mon, 19 Sep 2016 17:49:37 +0800 Subject: [PATCH 26/45] re --- docs/source/others/src/update.rst | 7 +++++-- docs/source/others/update.md | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/source/others/src/update.rst b/docs/source/others/src/update.rst index 8f5a53c90..09e656ddb 100644 --- a/docs/source/others/src/update.rst +++ b/docs/source/others/src/update.rst @@ -1,7 +1,10 @@ 版本更新 --------- +======== -2.6.6 发布于 20160911 +2.6.36 +------ + +2.6.36 发布于 20160911 - disconf-web: diff --git a/docs/source/others/update.md b/docs/source/others/update.md index ad70113f0..ac83143fc 100644 --- a/docs/source/others/update.md +++ b/docs/source/others/update.md @@ -1,7 +1,9 @@ +版本更新 +======= -## 版本更新 +## 2.6.36 -2.6.6 发布于 20160911 +2.6.36 发布于 20160911 - disconf-web: - 配置和配置项可支持自定义app https://github.com/knightliao/disconf/issues/147 From 6c7cbe6199aa6b8695ee3aa9ec468d8717c9d85c Mon Sep 17 00:00:00 2001 From: knightliao Date: Tue, 4 Oct 2016 23:26:37 +0800 Subject: [PATCH 27/45] re --- README.md | 1 + docs/source/index.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index c69347db6..44bde3d3a 100644 --- a/README.md +++ b/README.md @@ -90,3 +90,4 @@ Disconf的功能特点描述图: - disconf技术QQ二群: 280712860 - 有态度无广告的搜索引擎: https://www.sov5.com - 高质量的微信公众号阅读: http://www.100weidu.com +- Python中国社区: http://www.python88.com \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index 6f746162a..bc715ee4a 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -13,6 +13,7 @@ Distributed Configuration Management Platform(分布式配置管理平台) - 有态度无广告的搜索引擎: https://www.sov5.com - 高质量的微信公众号阅读: http://www.100weidu.com +- Python中国社区: http://www.python88.com .. toctree:: :maxdepth: 2 From 73cafb2f3d313fd9b966799b359050946a332066 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sat, 8 Oct 2016 15:14:00 +0800 Subject: [PATCH 28/45] re --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44bde3d3a..09a3bb38b 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Distributed Configuration Management Platform(分布式配置管理平台) - dev(dev branch): 2.6.36 - master(latest && cooperate && contribute branch):2.6.36 -- stable(release && stable branch): 2.6.35 +- stable(release && stable branch): 2.6.36 - 在Maven Central Repository里查看 [com.baidu.disconf](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.baidu.disconf%22 ) ## 功能特点 ## From 54c69f25cd46541d0cea7b1730c198fba4e4ac71 Mon Sep 17 00:00:00 2001 From: knightliao Date: Tue, 11 Oct 2016 16:08:08 +0800 Subject: [PATCH 29/45] re --- pom.xml | 330 +++++++++++++++++++------------------------------------- 1 file changed, 113 insertions(+), 217 deletions(-) diff --git a/pom.xml b/pom.xml index 04dcbd427..fc62fef0f 100644 --- a/pom.xml +++ b/pom.xml @@ -545,259 +545,155 @@ disconf-base - - - - - org.codehaus.mojo - cobertura-maven-plugin - 2.6 - - - xml - - true - - - **/*Proto.class - **/*Proto$*.class - **/*Test.class - **/*Controller.class - **/*Vo.class - **/*Form.class - **/baidu/ub/**/*.class - - - - - - package - - cobertura - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.1 - - ${source.version} - ${target.version} - ${encoding} - true - true - true - - - ${java.home}/lib/rt.jar - - - - - - org.codehaus.plexus - plexus-compiler-javac - 1.8.1 - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - - - org.apache.maven.plugins - maven-war-plugin - 2.1.1 - - ${project.basedir}/src/main/webapp/WEB-INF/web.xml - - - - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.10 - - - - org.apache.tomcat.maven - tomcat6-maven-plugin - 2.0 - - - - - org.codehaus.cargo - cargo-maven2-plugin - 1.2.0 - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.5 - - -Dfile.encoding=UTF-8 - - **/*TestCase.java - + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.6 + + + xml + html + + true + - **/*ServiceTest.java - **/TempDaoTest.java + **/*Proto.class + **/*Proto$*.class + **/*Test.class + **/*Controller.class + **/*Vo.class + **/*Form.class - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar - - - - - - - - org.eluder.coveralls - coveralls-maven-plugin - 3.1.0 - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - jar - - - - - - - - + + + + + package + + cobertura + + + + - - - + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.1 + + ${source.version} + ${target.version} + ${encoding} + true + true + true + + + ${java.home}/lib/rt.jar + + + + + + org.codehaus.plexus + plexus-compiler-javac + 1.8.1 + + + - + org.apache.maven.plugins - maven-checkstyle-plugin - 2.9.1 + maven-jar-plugin + 2.4 - + org.apache.maven.plugins - maven-pmd-plugin - 3.0.1 + maven-war-plugin + 2.1.1 - true - 1.6 + ${project.basedir}/src/main/webapp/WEB-INF/web.xml - + - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.7 - - - - index - summary - - - + org.mortbay.jetty + maven-jetty-plugin + 6.1.10 - + + org.apache.tomcat.maven + tomcat6-maven-plugin + 2.0 + + + + + org.codehaus.cargo + cargo-maven2-plugin + 1.2.0 + + + org.apache.maven.plugins - maven-surefire-report-plugin + maven-surefire-plugin 2.5 - true -Dfile.encoding=UTF-8 + + **/*TestCase.java + + + **/*ServiceTest.java + **/TempDaoTest.java + - - - - - report-only - - - - - org.codehaus.mojo - cobertura-maven-plugin - 2.6 - - UTF-8 - true - - xml - html - - - - **/*Proto.class - **/*Proto$*.class - **/*Test.class - **/*Controller.class - **/*Vo.class - **/*Form.class - - - - + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + - + - org.codehaus.mojo - findbugs-maven-plugin - 2.5.2 - - true - - + org.eluder.coveralls + coveralls-maven-plugin + 3.1.0 org.apache.maven.plugins - maven-release-plugin - 2.5 + maven-javadoc-plugin + + + attach-javadocs + + jar + + + - + From c066d8eeeeddf0f4c4b853290887a167bd645d42 Mon Sep 17 00:00:00 2001 From: knightliao Date: Mon, 7 Nov 2016 18:16:09 +0800 Subject: [PATCH 30/45] re --- disconf-web/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disconf-web/README.md b/disconf-web/README.md index 457f89fd7..96b570ba5 100644 --- a/disconf-web/README.md +++ b/disconf-web/README.md @@ -1,4 +1,4 @@ -disconf-web +disconf-web =========== 分布式配置Web平台服务 模块 From d7b0102af5b3ec374a8aacb1d2b0f4313eb70188 Mon Sep 17 00:00:00 2001 From: knightliao Date: Tue, 8 Nov 2016 20:40:14 +0800 Subject: [PATCH 31/45] remove trans for update config value --- .../web/service/config/service/ConfigMgr.java | 19 + .../config/service/impl/ConfigMgrImpl.java | 359 +++++++++--------- 2 files changed, 197 insertions(+), 181 deletions(-) diff --git a/disconf-web/src/main/java/com/baidu/disconf/web/service/config/service/ConfigMgr.java b/disconf-web/src/main/java/com/baidu/disconf/web/service/config/service/ConfigMgr.java index ed4563468..956ef5506 100644 --- a/disconf-web/src/main/java/com/baidu/disconf/web/service/config/service/ConfigMgr.java +++ b/disconf-web/src/main/java/com/baidu/disconf/web/service/config/service/ConfigMgr.java @@ -36,6 +36,11 @@ public interface ConfigMgr { */ ConfListVo getConfVo(Long configId); + /** + * @param configId + * + * @return + */ MachineListVo getConfVoWithZk(Long configId); /** @@ -55,20 +60,34 @@ public interface ConfigMgr { String updateItemValue(Long configId, String value); /** + * 获取config value + * * @param configId * * @return */ String getValue(Long configId); + /** + * 通知zk + * + * @param configId + */ void notifyZookeeper(Long configId); /** + * 新建一个config + * * @param confNewForm * @param disConfigTypeEnum */ void newConfig(ConfNewItemForm confNewForm, DisConfigTypeEnum disConfigTypeEnum); + /** + * 删除一个config + * + * @param configId + */ void delete(Long configId); /** diff --git a/disconf-web/src/main/java/com/baidu/disconf/web/service/config/service/impl/ConfigMgrImpl.java b/disconf-web/src/main/java/com/baidu/disconf/web/service/config/service/impl/ConfigMgrImpl.java index 4007dca5e..ba3b04b3f 100644 --- a/disconf-web/src/main/java/com/baidu/disconf/web/service/config/service/impl/ConfigMgrImpl.java +++ b/disconf-web/src/main/java/com/baidu/disconf/web/service/config/service/impl/ConfigMgrImpl.java @@ -16,8 +16,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; import com.baidu.disconf.core.common.constants.DisConfigTypeEnum; import com.baidu.disconf.web.common.Constants; @@ -113,7 +111,8 @@ public List getVersionListByAppEnv(Long appId, Long envId) { public List getDisconfFileList(ConfListForm confListForm) { List configList = - configDao.getConfigList(confListForm.getAppId(), confListForm.getEnvId(), confListForm.getVersion(),true); + configDao.getConfigList(confListForm.getAppId(), confListForm.getEnvId(), confListForm.getVersion(), + true); // 时间作为当前文件夹 String curTime = DateUtils.format(new Date(), DataFormatConstants.COMMON_TIME_FORMAT); @@ -202,154 +201,6 @@ public ConfListVo transfer(Config input) { return configListVo; } - /** - * 获取ZK data - */ - private MachineListVo getZkData(List datalist, Config config) { - - int errorNum = 0; - for (ZkDisconfDataItem zkDisconfDataItem : datalist) { - - if (config.getType().equals(DisConfigTypeEnum.FILE.getType())) { - - List errorKeyList = compareConfig(zkDisconfDataItem.getValue(), config.getValue()); - - if (errorKeyList.size() != 0) { - zkDisconfDataItem.setErrorList(errorKeyList); - errorNum++; - } - } else { - - // - // 配置项 - // - - if (zkDisconfDataItem.getValue().trim().equals(config.getValue().trim())) { - - } else { - List errorKeyList = new ArrayList(); - errorKeyList.add(config.getValue().trim()); - zkDisconfDataItem.setErrorList(errorKeyList); - errorNum++; - } - } - } - - MachineListVo machineListVo = new MachineListVo(); - machineListVo.setDatalist(datalist); - machineListVo.setErrorNum(errorNum); - machineListVo.setMachineSize(datalist.size()); - - return machineListVo; - } - - /** - * 转换成配置返回 - * - * @param config - * - * @return - */ - private ConfListVo convert(Config config, String appNameString, String envName, ZkDisconfData zkDisconfData) { - - ConfListVo confListVo = new ConfListVo(); - - confListVo.setConfigId(config.getId()); - confListVo.setAppId(config.getAppId()); - confListVo.setAppName(appNameString); - confListVo.setEnvName(envName); - confListVo.setEnvId(config.getEnvId()); - confListVo.setCreateTime(config.getCreateTime()); - confListVo.setModifyTime(config.getUpdateTime().substring(0, 12)); - confListVo.setKey(config.getName()); - // StringEscapeUtils.escapeHtml escape - confListVo.setValue(CodeUtils.unicodeToUtf8(config.getValue())); - confListVo.setVersion(config.getVersion()); - confListVo.setType(DisConfigTypeEnum.getByType(config.getType()).getModelName()); - confListVo.setTypeId(config.getType()); - - // - // - // - if (zkDisconfData != null) { - - confListVo.setMachineSize(zkDisconfData.getData().size()); - - List datalist = zkDisconfData.getData(); - - MachineListVo machineListVo = getZkData(datalist, config); - - confListVo.setErrorNum(machineListVo.getErrorNum()); - confListVo.setMachineList(machineListVo.getDatalist()); - confListVo.setMachineSize(machineListVo.getMachineSize()); - } - - return confListVo; - } - - /** - * - */ - private List compareConfig(String zkData, String dbData) { - - List errorKeyList = new ArrayList(); - - Properties prop = new Properties(); - try { - prop.load(IOUtils.toInputStream(dbData)); - } catch (Exception e) { - LOG.error(e.toString()); - errorKeyList.add(zkData); - return errorKeyList; - } - - Map zkMap = GsonUtils.parse2Map(zkData); - for (String keyInZk : zkMap.keySet()) { - - Object valueInDb = prop.get(keyInZk); - String zkDataStr = zkMap.get(keyInZk); - - // convert zk data to utf-8 - //zkMap.put(keyInZk, CodeUtils.unicodeToUtf8(zkDataStr)); - - try { - - if ((zkDataStr == null && valueInDb != null) || (zkDataStr != null && valueInDb == null)) { - errorKeyList.add(keyInZk); - - } else { - - zkDataStr = zkDataStr.trim(); - boolean isEqual = true; - - if (MyStringUtils.isDouble(zkDataStr) && MyStringUtils.isDouble(valueInDb.toString())) { - - if (Math.abs(Double.parseDouble(zkDataStr) - Double.parseDouble(valueInDb.toString())) > - 0.001d) { - isEqual = false; - } - - } else { - if (!zkDataStr.equals(valueInDb.toString().trim())) { - isEqual = false; - } - } - - if (!isEqual) { - errorKeyList - .add(keyInZk + "\t" + DiffUtils.getDiffSimple(zkDataStr, valueInDb.toString().trim())); - } - } - - } catch (Exception e) { - - LOG.warn(e.toString() + " ; " + keyInZk + " ; " + zkMap.get(keyInZk) + " ; " + valueInDb); - } - } - - return errorKeyList; - } - /** * 根据 配置ID获取配置返回 */ @@ -407,7 +258,6 @@ public Config getConfigById(Long configId) { * 更新 配置项/配置文件 的值 */ @Override - @Transactional(propagation = Propagation.REQUIRED, rollbackFor = RuntimeException.class) public String updateItemValue(Long configId, String value) { Config config = getConfigById(configId); @@ -440,35 +290,6 @@ public String updateItemValue(Long configId, String value) { return "修改成功"; } - /** - * 主要用于邮箱发送 - * - * @return - */ - private String getConfigUrlHtml(Config config) { - - return "
点击 这里 进入查看
"; - } - - /** - * 主要用于邮箱发送 - * - * @param newValue - * @param identify - * - * @return - */ - private String getNewValue(String newValue, String identify, String htmlClick) { - - String contentString = StringEscapeUtils.escapeHtml4(identify) + "
" + htmlClick + "

"; - - String data = "


New value:
"; - contentString = contentString + data + StringEscapeUtils.escapeHtml4(newValue); - - return contentString; - } - /** * 通知Zookeeper, 失败时不回滚数据库,通过监控来解决分布式不一致问题 */ @@ -546,4 +367,180 @@ public void delete(Long configId) { configDao.deleteItem(configId); } + /** + * 主要用于邮箱发送 + * + * @return + */ + private String getConfigUrlHtml(Config config) { + + return "
点击 这里 进入查看
"; + } + + /** + * 主要用于邮箱发送 + * + * @param newValue + * @param identify + * + * @return + */ + private String getNewValue(String newValue, String identify, String htmlClick) { + + String contentString = StringEscapeUtils.escapeHtml4(identify) + "
" + htmlClick + "

"; + + String data = "


New value:
"; + contentString = contentString + data + StringEscapeUtils.escapeHtml4(newValue); + + return contentString; + } + + /** + * + */ + private List compareConfig(String zkData, String dbData) { + + List errorKeyList = new ArrayList(); + + Properties prop = new Properties(); + try { + prop.load(IOUtils.toInputStream(dbData)); + } catch (Exception e) { + LOG.error(e.toString()); + errorKeyList.add(zkData); + return errorKeyList; + } + + Map zkMap = GsonUtils.parse2Map(zkData); + for (String keyInZk : zkMap.keySet()) { + + Object valueInDb = prop.get(keyInZk); + String zkDataStr = zkMap.get(keyInZk); + + // convert zk data to utf-8 + //zkMap.put(keyInZk, CodeUtils.unicodeToUtf8(zkDataStr)); + + try { + + if ((zkDataStr == null && valueInDb != null) || (zkDataStr != null && valueInDb == null)) { + errorKeyList.add(keyInZk); + + } else { + + zkDataStr = zkDataStr.trim(); + boolean isEqual = true; + + if (MyStringUtils.isDouble(zkDataStr) && MyStringUtils.isDouble(valueInDb.toString())) { + + if (Math.abs(Double.parseDouble(zkDataStr) - Double.parseDouble(valueInDb.toString())) > + 0.001d) { + isEqual = false; + } + + } else { + if (!zkDataStr.equals(valueInDb.toString().trim())) { + isEqual = false; + } + } + + if (!isEqual) { + errorKeyList + .add(keyInZk + "\t" + DiffUtils.getDiffSimple(zkDataStr, valueInDb.toString().trim())); + } + } + + } catch (Exception e) { + + LOG.warn(e.toString() + " ; " + keyInZk + " ; " + zkMap.get(keyInZk) + " ; " + valueInDb); + } + } + + return errorKeyList; + } + + /** + * 转换成配置返回 + * + * @param config + * + * @return + */ + private ConfListVo convert(Config config, String appNameString, String envName, ZkDisconfData zkDisconfData) { + + ConfListVo confListVo = new ConfListVo(); + + confListVo.setConfigId(config.getId()); + confListVo.setAppId(config.getAppId()); + confListVo.setAppName(appNameString); + confListVo.setEnvName(envName); + confListVo.setEnvId(config.getEnvId()); + confListVo.setCreateTime(config.getCreateTime()); + confListVo.setModifyTime(config.getUpdateTime().substring(0, 12)); + confListVo.setKey(config.getName()); + // StringEscapeUtils.escapeHtml escape + confListVo.setValue(CodeUtils.unicodeToUtf8(config.getValue())); + confListVo.setVersion(config.getVersion()); + confListVo.setType(DisConfigTypeEnum.getByType(config.getType()).getModelName()); + confListVo.setTypeId(config.getType()); + + // + // + // + if (zkDisconfData != null) { + + confListVo.setMachineSize(zkDisconfData.getData().size()); + + List datalist = zkDisconfData.getData(); + + MachineListVo machineListVo = getZkData(datalist, config); + + confListVo.setErrorNum(machineListVo.getErrorNum()); + confListVo.setMachineList(machineListVo.getDatalist()); + confListVo.setMachineSize(machineListVo.getMachineSize()); + } + + return confListVo; + } + + /** + * 获取ZK data + */ + private MachineListVo getZkData(List datalist, Config config) { + + int errorNum = 0; + for (ZkDisconfDataItem zkDisconfDataItem : datalist) { + + if (config.getType().equals(DisConfigTypeEnum.FILE.getType())) { + + List errorKeyList = compareConfig(zkDisconfDataItem.getValue(), config.getValue()); + + if (errorKeyList.size() != 0) { + zkDisconfDataItem.setErrorList(errorKeyList); + errorNum++; + } + } else { + + // + // 配置项 + // + + if (zkDisconfDataItem.getValue().trim().equals(config.getValue().trim())) { + + } else { + List errorKeyList = new ArrayList(); + errorKeyList.add(config.getValue().trim()); + zkDisconfDataItem.setErrorList(errorKeyList); + errorNum++; + } + } + } + + MachineListVo machineListVo = new MachineListVo(); + machineListVo.setDatalist(datalist); + machineListVo.setErrorNum(errorNum); + machineListVo.setMachineSize(datalist.size()); + + return machineListVo; + } } From 0988bfca224939ae8b953f8d520d75cca3baff7b Mon Sep 17 00:00:00 2001 From: knightliao Date: Sat, 10 Dec 2016 20:10:08 +0800 Subject: [PATCH 32/45] re --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 09a3bb38b..5f5397f0a 100644 --- a/README.md +++ b/README.md @@ -89,5 +89,8 @@ Disconf的功能特点描述图: - disconf技术QQ群: 239203866 - disconf技术QQ二群: 280712860 - 有态度无广告的搜索引擎: https://www.sov5.com -- 高质量的微信公众号阅读: http://www.100weidu.com -- Python中国社区: http://www.python88.com \ No newline at end of file +- 微读 - 高品质阅读: http://www.100weidu.com +- Python中国社区: http://www.python88.com +- Disconf - 分布式配置管理平台: http://github.com/knightliao/disconf +- CanalX - 基于 `Canal` 的数据感知服务框架: http://github.com/knightliao/canalX +- jutf - Java Unit Test Framework: https://github.com/knightliao/jutf From 8f9872901c399542e7bdd77fd5497dbbd461c1f4 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sat, 10 Dec 2016 20:14:35 +0800 Subject: [PATCH 33/45] re --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5f5397f0a..552875bd8 100644 --- a/README.md +++ b/README.md @@ -94,3 +94,5 @@ Disconf的功能特点描述图: - Disconf - 分布式配置管理平台: http://github.com/knightliao/disconf - CanalX - 基于 `Canal` 的数据感知服务框架: http://github.com/knightliao/canalX - jutf - Java Unit Test Framework: https://github.com/knightliao/jutf +- pfrock - A plugin-based server for running fake HTTP services (especially SOA service): https://github.com/knightliao/pfrock + \ No newline at end of file From b5378707433ebe9c69acad0666569824e18e9a6e Mon Sep 17 00:00:00 2001 From: knightliao Date: Sat, 10 Dec 2016 22:39:03 +0800 Subject: [PATCH 34/45] re --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 552875bd8..f3d73e532 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ -Disconf [![Build Status](https://travis-ci.org/knightliao/disconf.svg?branch=master)](https://travis-ci.org/knightliao/disconf) [![Coverage Status](https://coveralls.io/repos/knightliao/disconf/badge.png?branch=master)](https://coveralls.io/r/knightliao/disconf?branch=master) +Disconf ======= +[![Apache License 2](https://img.shields.io/badge/license-ASF2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt) +[![Build Status](https://travis-ci.org/knightliao/disconf.svg?branch=master)](https://travis-ci.org/knightliao/disconf) +[![Coverage Status](https://coveralls.io/repos/knightliao/disconf/badge.png?branch=master)](https://coveralls.io/r/knightliao/disconf?branch=master) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.baidu.disconf/disconf-client/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/com.baidu.disconf/disconf-client) + Distributed Configuration Management Platform(分布式配置管理平台) 专注于各种「分布式系统配置管理」的「通用组件」和「通用平台」, 提供统一的「配置管理服务」 @@ -31,7 +36,6 @@ Distributed Configuration Management Platform(分布式配置管理平台) - dev(dev branch): 2.6.36 - master(latest && cooperate && contribute branch):2.6.36 - stable(release && stable branch): 2.6.36 -- 在Maven Central Repository里查看 [com.baidu.disconf](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.baidu.disconf%22 ) ## 功能特点 ## From c7546e9a58dbfba6922f858eae1c8a418e209940 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sat, 10 Dec 2016 22:46:40 +0800 Subject: [PATCH 35/45] re --- docs/source/others/sponsor.md | 2 +- docs/source/others/src/sponsor.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/others/sponsor.md b/docs/source/others/sponsor.md index 744ba62b2..ae890dc3d 100644 --- a/docs/source/others/sponsor.md +++ b/docs/source/others/sponsor.md @@ -11,4 +11,4 @@ 如果您觉得disconf不错,可以资助作者, 资助公司或个人会留下名字。 -![](http://ww3.sinaimg.cn/bmiddle/60c9620fjw1ergyopdbxpj207i07iaag.jpg) \ No newline at end of file +![](http://ww4.sinaimg.cn/mw690/006pzvAPgw1fam2shzciqj30no0zkq54.jpg) \ No newline at end of file diff --git a/docs/source/others/src/sponsor.rst b/docs/source/others/src/sponsor.rst index 47e48991f..0ffa51f80 100644 --- a/docs/source/others/src/sponsor.rst +++ b/docs/source/others/src/sponsor.rst @@ -15,5 +15,5 @@ |image0| -.. |image0| image:: http://ww3.sinaimg.cn/bmiddle/60c9620fjw1ergyopdbxpj207i07iaag.jpg +.. |image0| image:: http://ww4.sinaimg.cn/mw690/006pzvAPgw1fam2shzciqj30no0zkq54.jpg From 9bdca110dab8d865003ed3c318cde878e9761e6f Mon Sep 17 00:00:00 2001 From: knightliao Date: Sat, 10 Dec 2016 22:47:29 +0800 Subject: [PATCH 36/45] re --- README.md | 1 + docs/source/others/sponsor.md | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f3d73e532..20c58dfb1 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ Disconf的功能特点描述图: ## 群·联系·讨论 +- 赞助作者: http://disconf.readthedocs.io/zh_CN/latest/others/src/sponsor.html - disconf技术QQ群: 239203866 - disconf技术QQ二群: 280712860 - 有态度无广告的搜索引擎: https://www.sov5.com diff --git a/docs/source/others/sponsor.md b/docs/source/others/sponsor.md index ae890dc3d..b0d7188f7 100644 --- a/docs/source/others/sponsor.md +++ b/docs/source/others/sponsor.md @@ -1,14 +1,14 @@ 联系和赞助 ======== +## 赞助 + +如果您觉得disconf不错,可以资助作者, 资助公司或个人会留下名字。 + +![](http://ww4.sinaimg.cn/mw690/006pzvAPgw1fam2shzciqj30no0zkq54.jpg) + ## 联系我 - weibo: [http://weibo.com/knightliao](http://weibo.com/knightliao) - wechat: knightliao - 主页: http://liaoqiqi.com - -## 赞助 - -如果您觉得disconf不错,可以资助作者, 资助公司或个人会留下名字。 - -![](http://ww4.sinaimg.cn/mw690/006pzvAPgw1fam2shzciqj30no0zkq54.jpg) \ No newline at end of file From 2ac5c8275ad8cdc101522ad01a8ba87e53b73b68 Mon Sep 17 00:00:00 2001 From: knightliao Date: Sat, 10 Dec 2016 22:47:42 +0800 Subject: [PATCH 37/45] re --- docs/source/others/src/sponsor.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/others/src/sponsor.rst b/docs/source/others/src/sponsor.rst index 0ffa51f80..79f9160b0 100644 --- a/docs/source/others/src/sponsor.rst +++ b/docs/source/others/src/sponsor.rst @@ -1,13 +1,6 @@ 联系和赞助 ========== -联系我 ------- - -- weibo: http://weibo.com/knightliao -- wechat: knightliao -- 主页: http://liaoqiqi.com - 赞助 ---- @@ -15,5 +8,12 @@ |image0| +联系我 +------ + +- weibo: http://weibo.com/knightliao +- wechat: knightliao +- 主页: http://liaoqiqi.com + .. |image0| image:: http://ww4.sinaimg.cn/mw690/006pzvAPgw1fam2shzciqj30no0zkq54.jpg From 561a200d4ea1f201cae836d5f7a4b1962314ee45 Mon Sep 17 00:00:00 2001 From: Qiqi Liao Date: Thu, 26 Jul 2018 14:29:23 +0800 Subject: [PATCH 38/45] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 20c58dfb1..668384409 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Disconf [![Coverage Status](https://coveralls.io/repos/knightliao/disconf/badge.png?branch=master)](https://coveralls.io/r/knightliao/disconf?branch=master) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.baidu.disconf/disconf-client/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/com.baidu.disconf/disconf-client) +招聘:我的团队开始招聘啦! https://shimo.im/docs/mOqakWapJlMh91WP + Distributed Configuration Management Platform(分布式配置管理平台) 专注于各种「分布式系统配置管理」的「通用组件」和「通用平台」, 提供统一的「配置管理服务」 @@ -90,14 +92,12 @@ Disconf的功能特点描述图: ## 群·联系·讨论 -- 赞助作者: http://disconf.readthedocs.io/zh_CN/latest/others/src/sponsor.html -- disconf技术QQ群: 239203866 -- disconf技术QQ二群: 280712860 -- 有态度无广告的搜索引擎: https://www.sov5.com -- 微读 - 高品质阅读: http://www.100weidu.com -- Python中国社区: http://www.python88.com +- 招聘:我的团队开始招聘啦! https://shimo.im/docs/mOqakWapJlMh91WP +- 搜索引擎: https://www.sov5.cn +- 内容开放平台: http://open.sov5.cn +- 今天看啥 - 高品质阅读: http://www.jintiankansha.me - Disconf - 分布式配置管理平台: http://github.com/knightliao/disconf - CanalX - 基于 `Canal` 的数据感知服务框架: http://github.com/knightliao/canalX - jutf - Java Unit Test Framework: https://github.com/knightliao/jutf - pfrock - A plugin-based server for running fake HTTP services (especially SOA service): https://github.com/knightliao/pfrock - \ No newline at end of file + From d413cbce9334fe38a5a24982ce4db3a6ed8e98ea Mon Sep 17 00:00:00 2001 From: Qiqi Liao Date: Thu, 26 Jul 2018 14:31:05 +0800 Subject: [PATCH 39/45] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 668384409..88de1d7e1 100644 --- a/README.md +++ b/README.md @@ -90,9 +90,11 @@ Disconf的功能特点描述图: ![http://ww4.sinaimg.cn/bmiddle/60c9620fjw1est6pzqo68j208k05tjrm.jpg](http://ww4.sinaimg.cn/bmiddle/60c9620fjw1est6pzqo68j208k05tjrm.jpg) -## 群·联系·讨论 +## 团队招聘 - 招聘:我的团队开始招聘啦! https://shimo.im/docs/mOqakWapJlMh91WP + +## 我的其它作品 - 搜索引擎: https://www.sov5.cn - 内容开放平台: http://open.sov5.cn - 今天看啥 - 高品质阅读: http://www.jintiankansha.me From 23f6d3d191dc1d17beaa470a0f65e3baf69db759 Mon Sep 17 00:00:00 2001 From: knightliao Date: Tue, 28 Sep 2021 00:58:19 +0800 Subject: [PATCH 40/45] fix pack --- README.md | 13 +------------ disconf-web/pom.xml | 2 +- pom.xml | 11 ++++++----- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 20c58dfb1..46ae613b8 100644 --- a/README.md +++ b/README.md @@ -88,16 +88,5 @@ Disconf的功能特点描述图: ![http://ww4.sinaimg.cn/bmiddle/60c9620fjw1est6pzqo68j208k05tjrm.jpg](http://ww4.sinaimg.cn/bmiddle/60c9620fjw1est6pzqo68j208k05tjrm.jpg) -## 群·联系·讨论 - -- 赞助作者: http://disconf.readthedocs.io/zh_CN/latest/others/src/sponsor.html -- disconf技术QQ群: 239203866 -- disconf技术QQ二群: 280712860 -- 有态度无广告的搜索引擎: https://www.sov5.com -- 微读 - 高品质阅读: http://www.100weidu.com -- Python中国社区: http://www.python88.com -- Disconf - 分布式配置管理平台: http://github.com/knightliao/disconf -- CanalX - 基于 `Canal` 的数据感知服务框架: http://github.com/knightliao/canalX -- jutf - Java Unit Test Framework: https://github.com/knightliao/jutf -- pfrock - A plugin-based server for running fake HTTP services (especially SOA service): https://github.com/knightliao/pfrock + \ No newline at end of file diff --git a/disconf-web/pom.xml b/disconf-web/pom.xml index c6628aab5..b5d2ea7b5 100644 --- a/disconf-web/pom.xml +++ b/disconf-web/pom.xml @@ -123,7 +123,7 @@ org.apache.commons commons-compress - 1.7 + 1.21 diff --git a/pom.xml b/pom.xml index fc62fef0f..c908ab063 100644 --- a/pom.xml +++ b/pom.xml @@ -11,6 +11,7 @@ disconf-client disconf-core + disconf-web 2015 @@ -101,7 +102,7 @@ commons-collections commons-collections - 3.2 + 3.2.2 @@ -225,7 +226,7 @@ com.fasterxml.jackson.core jackson-databind - 2.6.0 + 2.9.10.7 @@ -477,19 +478,19 @@ ch.qos.logback logback-core - 1.0.9 + 1.2.0 ch.qos.logback logback-classic - 1.0.9 + 1.2.0 log4j log4j - 1.2.14 + 1.2.17 com.sun.jmx From f95a68d69ebd8cb91540419e5f711fc83abbb782 Mon Sep 17 00:00:00 2001 From: knightliao Date: Tue, 28 Sep 2021 02:04:35 +0800 Subject: [PATCH 41/45] update --- disconf-client/pom.xml | 6 -- disconf-core/pom.xml | 22 +------ .../recipes/lock/ProtocolSupport.java | 12 ++-- .../zookeeper/recipes/lock/WriteLock.java | 20 +++--- .../zookeeper/recipes/lock/ZNodeName.java | 10 +-- .../core/test/common/BaseCoreTestCase.java | 1 - disconf-web/pom.xml | 28 -------- pom.xml | 64 +++++-------------- 8 files changed, 38 insertions(+), 125 deletions(-) diff --git a/disconf-client/pom.xml b/disconf-client/pom.xml index 524931042..2f809bdbb 100644 --- a/disconf-client/pom.xml +++ b/disconf-client/pom.xml @@ -92,12 +92,6 @@ - - ch.qos.logback - logback-core - provided - - ch.qos.logback logback-classic diff --git a/disconf-core/pom.xml b/disconf-core/pom.xml index 39145c935..435635a2e 100644 --- a/disconf-core/pom.xml +++ b/disconf-core/pom.xml @@ -43,7 +43,7 @@ org.apache.httpcomponents httpclient - 4.5.1 + 4.5.13 @@ -86,26 +86,6 @@ slf4j-api - - log4j - log4j - provided - - - com.sun.jmx - jmxri - - - com.sun.jdmk - jmxtools - - - javax.jms - jms - - - - diff --git a/disconf-core/src/main/java/org/apache/zookeeper/recipes/lock/ProtocolSupport.java b/disconf-core/src/main/java/org/apache/zookeeper/recipes/lock/ProtocolSupport.java index 0bedcf785..3754a297f 100644 --- a/disconf-core/src/main/java/org/apache/zookeeper/recipes/lock/ProtocolSupport.java +++ b/disconf-core/src/main/java/org/apache/zookeeper/recipes/lock/ProtocolSupport.java @@ -1,14 +1,13 @@ /** - * * 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. @@ -20,13 +19,14 @@ import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.log4j.Logger; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.ZooDefs; import org.apache.zookeeper.ZooKeeper; import org.apache.zookeeper.data.ACL; import org.apache.zookeeper.data.Stat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A base class for protocol implementations which provides a number of higher @@ -35,7 +35,7 @@ * {@link #retryOperation(ZooKeeperOperation)} */ class ProtocolSupport { - private static final Logger LOG = Logger.getLogger(ProtocolSupport.class); + private static final Logger LOG = LoggerFactory.getLogger(ProtocolSupport.class); protected final ZooKeeper zookeeper; private AtomicBoolean closed = new AtomicBoolean(false); @@ -128,7 +128,7 @@ protected Object retryOperation(ZooKeeperOperation operation) throws KeeperExcep exception = e; } LOG.debug("Attempt " + i + " failed with connection loss so " + - "attempting to reconnect: " + e, e); + "attempting to reconnect: " + e, e); retryDelay(i); } } diff --git a/disconf-core/src/main/java/org/apache/zookeeper/recipes/lock/WriteLock.java b/disconf-core/src/main/java/org/apache/zookeeper/recipes/lock/WriteLock.java index e01f827a8..a05e520cd 100644 --- a/disconf-core/src/main/java/org/apache/zookeeper/recipes/lock/WriteLock.java +++ b/disconf-core/src/main/java/org/apache/zookeeper/recipes/lock/WriteLock.java @@ -1,14 +1,13 @@ /** - * * 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. @@ -23,13 +22,14 @@ import java.util.SortedSet; import java.util.TreeSet; -import org.apache.log4j.Logger; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.WatchedEvent; import org.apache.zookeeper.Watcher; import org.apache.zookeeper.ZooKeeper; import org.apache.zookeeper.data.ACL; import org.apache.zookeeper.data.Stat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A protocol to implement an exclusive @@ -40,7 +40,7 @@ * by calling {@link #isOwner()} */ public class WriteLock extends ProtocolSupport { - private static final Logger LOG = Logger.getLogger(WriteLock.class); + private static final Logger LOG = LoggerFactory.getLogger(WriteLock.class); private final String dir; private String id; @@ -132,7 +132,7 @@ public boolean execute() throws KeeperException, InterruptedException { } catch (KeeperException e) { LOG.warn("Caught: " + e, e); throw (RuntimeException) new RuntimeException(e.getMessage()). - initCause(e); + initCause(e); } finally { if (callback != null) { callback.lockReleased(); @@ -151,7 +151,7 @@ private class LockWatcher implements Watcher { public void process(WatchedEvent event) { // lets either become the leader or watch the new/updated node LOG.debug("Watcher fired on path: " + event.getPath() + " state: " + - event.getState() + " type " + event.getType()); + event.getState() + " type " + event.getType()); try { lock(); } catch (Exception e) { @@ -177,7 +177,7 @@ private class LockZooKeeperOperation implements ZooKeeperOperation { * @throws InterruptedException */ private void findPrefixInChildren(String prefix, ZooKeeper zookeeper, String dir) - throws KeeperException, InterruptedException { + throws KeeperException, InterruptedException { List names = zookeeper.getChildren(dir, false); for (String name : names) { if (name.startsWith(prefix)) { @@ -218,7 +218,7 @@ public boolean execute() throws KeeperException, InterruptedException { List names = zookeeper.getChildren(dir, false); if (names.isEmpty()) { LOG.warn("No children in: " + dir + " when we've just " + - "created one! Lets recreate it..."); + "created one! Lets recreate it..."); // lets force the recreation of the id id = null; } else { @@ -240,7 +240,7 @@ public boolean execute() throws KeeperException, InterruptedException { return Boolean.FALSE; } else { LOG.warn("Could not find the" + - " stats for less than me: " + lastChildName.getName()); + " stats for less than me: " + lastChildName.getName()); } } else { if (isOwner()) { diff --git a/disconf-core/src/main/java/org/apache/zookeeper/recipes/lock/ZNodeName.java b/disconf-core/src/main/java/org/apache/zookeeper/recipes/lock/ZNodeName.java index fcb207ed9..4eb1b7e24 100644 --- a/disconf-core/src/main/java/org/apache/zookeeper/recipes/lock/ZNodeName.java +++ b/disconf-core/src/main/java/org/apache/zookeeper/recipes/lock/ZNodeName.java @@ -1,14 +1,13 @@ /** - * * 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. @@ -17,7 +16,8 @@ */ package org.apache.zookeeper.recipes.lock; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Represents an ephemeral znode name which has an ordered sequence number @@ -27,7 +27,7 @@ class ZNodeName implements Comparable { private final String name; private String prefix; private int sequence = -1; - private static final Logger LOG = Logger.getLogger(ZNodeName.class); + private static final Logger LOG = LoggerFactory.getLogger(ZNodeName.class); public ZNodeName(String name) { if (name == null) { diff --git a/disconf-core/src/test/java/com/baidu/disconf/core/test/common/BaseCoreTestCase.java b/disconf-core/src/test/java/com/baidu/disconf/core/test/common/BaseCoreTestCase.java index 195e98384..a366f6d92 100644 --- a/disconf-core/src/test/java/com/baidu/disconf/core/test/common/BaseCoreTestCase.java +++ b/disconf-core/src/test/java/com/baidu/disconf/core/test/common/BaseCoreTestCase.java @@ -25,7 +25,6 @@ public class BaseCoreTestCase { @ClassRule - @Rule public static WireMockClassRule wireMockRule = new WireMockClassRule(RemoteMockServer.PORT); protected static final Logger LOGGER = LoggerFactory.getLogger(BaseCoreTestCase.class); diff --git a/disconf-web/pom.xml b/disconf-web/pom.xml index b5d2ea7b5..2f32b7750 100644 --- a/disconf-web/pom.xml +++ b/disconf-web/pom.xml @@ -276,34 +276,6 @@ - - log4j - log4j - - - javax.mail - mail - - - javax.jms - jms - - - com.sun.jdmk - jmxtools - - - com.sun.jmx - jmxri - - - - - - ch.qos.logback - logback-core - - ch.qos.logback logback-classic diff --git a/pom.xml b/pom.xml index c908ab063..283be59a5 100644 --- a/pom.xml +++ b/pom.xml @@ -36,12 +36,12 @@ UTF-8 - 1.6 - 1.6 - 1.6 + 1.7 + 1.7 + 1.7 4.1.7.RELEASE 1.4.5.RELEASE - 4.10 + 4.12 2.0 2.5 2.2.2 @@ -96,7 +96,7 @@ commons-beanutils commons-beanutils - 1.6 + 1.9.4 @@ -120,13 +120,13 @@ commons-fileupload commons-fileupload - 1.2.1 + 1.3.3 commons-io commons-io - 1.4 + 2.7 @@ -152,7 +152,7 @@ org.apache.zookeeper zookeeper - 3.3.6 + 3.4.14 com.sun.jmx @@ -463,48 +463,16 @@ - - org.slf4j - slf4j-nop - 1.7.6 - - org.slf4j slf4j-api - 1.7.6 - - - - ch.qos.logback - logback-core - 1.2.0 + 1.7.25 ch.qos.logback logback-classic - 1.2.0 - - - - log4j - log4j - 1.2.17 - - - com.sun.jmx - jmxri - - - com.sun.jdmk - jmxtools - - - javax.jms - jms - - + 1.2.5 @@ -517,12 +485,6 @@ standalone - - org.slf4j - slf4j-log4j12 - 1.4.3 - - @@ -683,6 +645,12 @@ org.apache.maven.plugins maven-javadoc-plugin + + + + -Xdoclint:none + + attach-javadocs From 4efbd1e8c630c652b90b95db7cf0f6098ad4179f Mon Sep 17 00:00:00 2001 From: knightliao Date: Tue, 28 Sep 2021 02:09:33 +0800 Subject: [PATCH 42/45] re --- disconf-core/pom.xml | 1 - disconf-web/pom.xml | 1 - pom.xml | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/disconf-core/pom.xml b/disconf-core/pom.xml index 435635a2e..232b3b972 100644 --- a/disconf-core/pom.xml +++ b/disconf-core/pom.xml @@ -32,7 +32,6 @@ com.google.guava guava - 19.0-rc2 diff --git a/disconf-web/pom.xml b/disconf-web/pom.xml index 2f32b7750..2a0e3145d 100644 --- a/disconf-web/pom.xml +++ b/disconf-web/pom.xml @@ -240,7 +240,6 @@ commons-io commons-io - 2.4 diff --git a/pom.xml b/pom.xml index 283be59a5..8ac486b13 100644 --- a/pom.xml +++ b/pom.xml @@ -232,7 +232,7 @@ mysql mysql-connector-java - 5.1.6 + 8.0.16 @@ -274,7 +274,7 @@ com.google.guava guava - 19.0-rc2 + 30.0-jre From 02227c0f80b76c5af2eea17c1f376c55ea58be81 Mon Sep 17 00:00:00 2001 From: knightliao Date: Tue, 28 Sep 2021 02:11:20 +0800 Subject: [PATCH 43/45] re --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8ac486b13..6fc9300e3 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ 1.7 4.1.7.RELEASE 1.4.5.RELEASE - 4.12 + 4.13.1 2.0 2.5 2.2.2 From 904ab7a3c82a42d3babd0e19049c65a41901f76a Mon Sep 17 00:00:00 2001 From: knightliao Date: Tue, 28 Sep 2021 02:19:14 +0800 Subject: [PATCH 44/45] re --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6fc9300e3..37afe301c 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ 1.7 1.7 1.7 - 4.1.7.RELEASE + 4.3.20.RELEASE 1.4.5.RELEASE 4.13.1 2.0 From 872e69c71bc34ad6f3d6bead1bb1f96a5e9cfdb4 Mon Sep 17 00:00:00 2001 From: knightliao Date: Tue, 28 Sep 2021 02:28:00 +0800 Subject: [PATCH 45/45] re --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 37afe301c..1f9e404af 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ 1.7 1.7 1.7 - 4.3.20.RELEASE + 4.3.26.RELEASE 1.4.5.RELEASE 4.13.1 2.0