Skip to content

Commit

Permalink
update to 2.6.26
Browse files Browse the repository at this point in the history
  • Loading branch information
knightliao committed Oct 26, 2015
1 parent 792559e commit 2aaf272
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 76 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Distributed Configuration Management Platform(分布式配置管理平台)

disconf.git branches and Maven version:

- dev(develop branch): 2.6.25-SNAPSHOT
- master(stable branch):2.6.25
- dev(develop branch): 2.6.26-SNAPSHOT
- master(stable branch):2.6.26
- [更新日志](https://github.com/knightliao/disconf/wiki/updates)

在Maven Central Repository里查看 [com.baidu.disconf](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.baidu.disconf%22 )
Expand All @@ -40,7 +40,7 @@ disconf.git branches and Maven version:

[查看大图](http://ww1.sinaimg.cn/mw1024/60c9620fgw1eu5ltt9uglj20ia0j0tbo.jpg)

### 当前版本(2.6.25)功能特点 ##
### 当前版本(2.6.26)功能特点 ##

- **支持配置(配置项+配置文件)的分布式化管理**
- **配置发布统一化**
Expand Down Expand Up @@ -121,7 +121,7 @@ Disconf为应用方提供了三个工具,
<dependency>
<groupId>com.baidu.disconf</groupId>
<artifactId>disconf-client</artifactId>
<version>2.6.25</version>
<version>2.6.26</version>
</dependency>

### disconf-web 使用 ###
Expand Down
2 changes: 1 addition & 1 deletion disconf-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.baidu.disconf</groupId>
<artifactId>disconf-base</artifactId>
<version>2.6.26-SNAPSHOT</version>
<version>2.6.26</version>
<relativePath>../</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public String toString() {
@Override
public String infoString() {
return "\n\tDisconfCenterFile [\n\tkeyMaps=" + keyMaps + "\n" +
"\tadditionalKeyMaps=\" + additionalKeyMaps + \n\tcls=" + cls + super.infoString() + "]";
"\tadditionalKeyMaps=" + additionalKeyMaps + "\n\tcls=" + cls + super.infoString() + "]";
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
/**
* 配置文件服务器 HOST
*/
public static final String CONF_SERVER_HOST_NAME = "conf_server_host";
public static final String CONF_SERVER_HOST_NAME = "disconf.conf_server_host";
@DisInnerConfigAnnotation(name = DisClientConfig.CONF_SERVER_HOST_NAME)
public String CONF_SERVER_HOST;

Expand All @@ -84,7 +84,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
public static final String APP_NAME = "app";
public static final String APP_NAME = "disconf.app";
@DisInnerConfigAnnotation(name = DisClientConfig.APP_NAME)
public String APP;

Expand All @@ -94,7 +94,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
public static final String VERSION_NAME = "version";
public static final String VERSION_NAME = "disconf.version";
@DisInnerConfigAnnotation(name = DisClientConfig.VERSION_NAME, defaultValue = Constants.DEFAULT_VERSION)
public String VERSION = Constants.DEFAULT_VERSION;

Expand All @@ -104,7 +104,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
@DisInnerConfigAnnotation(name = "maintype")
@DisInnerConfigAnnotation(name = "disconf.maintype")
public String MAIN_TYPE;

/**
Expand All @@ -113,7 +113,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
public static final String ENV_NAME = "env";
public static final String ENV_NAME = "disconf.env";
@DisInnerConfigAnnotation(name = DisClientConfig.ENV_NAME, defaultValue = Constants.DEFAULT_ENV)
public String ENV = Constants.DEFAULT_ENV;

Expand All @@ -123,7 +123,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
private static final String ENABLE_REMOTE_CONF_NAME = "enable.remote.conf";
private static final String ENABLE_REMOTE_CONF_NAME = "disconf.enable.remote.conf";
@DisInnerConfigAnnotation(name = DisClientConfig.ENABLE_REMOTE_CONF_NAME, defaultValue = "false")
public boolean ENABLE_DISCONF = false;

Expand All @@ -135,7 +135,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
@DisInnerConfigAnnotation(name = "debug", defaultValue = "false")
@DisInnerConfigAnnotation(name = "disconf.debug", defaultValue = "false")
public boolean DEBUG = false;

/**
Expand All @@ -144,7 +144,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
@DisInnerConfigAnnotation(name = "ignore", defaultValue = "")
@DisInnerConfigAnnotation(name = "disconf.ignore", defaultValue = "")
public String IGNORE_DISCONF_LIST = "";
private Set<String> ignoreDisconfKeySet = new HashSet<String>();

Expand All @@ -154,7 +154,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
@DisInnerConfigAnnotation(name = "conf_server_url_retry_times", defaultValue = "3")
@DisInnerConfigAnnotation(name = "disconf.conf_server_url_retry_times", defaultValue = "3")
public int CONF_SERVER_URL_RETRY_TIMES = 3;

/**
Expand All @@ -163,7 +163,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
@DisInnerConfigAnnotation(name = "user_define_download_dir", defaultValue = "./disconf/download")
@DisInnerConfigAnnotation(name = "disconf.user_define_download_dir", defaultValue = "./disconf/download")
public String userDefineDownloadDir = "./disconf/download";

/**
Expand All @@ -172,7 +172,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
@DisInnerConfigAnnotation(name = "conf_server_url_retry_sleep_seconds", defaultValue = "2")
@DisInnerConfigAnnotation(name = "disconf.conf_server_url_retry_sleep_seconds", defaultValue = "2")
public int confServerUrlRetrySleepSeconds = 2;

public List<String> getHostList() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
@DisInnerConfigAnnotation(name = "conf_server_store_action")
@DisInnerConfigAnnotation(name = "disconf.conf_server_store_action")
public String CONF_SERVER_STORE_ACTION;

/**
Expand All @@ -70,7 +70,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
@DisInnerConfigAnnotation(name = "conf_server_zoo_action")
@DisInnerConfigAnnotation(name = "disconf.conf_server_zoo_action")
public String CONF_SERVER_ZOO_ACTION;

/**
Expand All @@ -79,7 +79,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
@DisInnerConfigAnnotation(name = "conf_server_master_num_action")
@DisInnerConfigAnnotation(name = "disconf.conf_server_master_num_action")
public String CONF_SERVER_MASTER_NUM_ACTION;

/**
Expand All @@ -88,7 +88,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
@DisInnerConfigAnnotation(name = "local_download_dir")
@DisInnerConfigAnnotation(name = "disconf.local_download_dir")
public String LOCAL_DOWNLOAD_DIR;

/**
Expand All @@ -97,7 +97,7 @@ public synchronized void loadConfig(String filePath) throws Exception {
* @author
* @since 1.0.0
*/
@DisInnerConfigAnnotation(name = "enable_local_download_dir_in_class_path", defaultValue = "true")
@DisInnerConfigAnnotation(name = "disconf.enable_local_download_dir_in_class_path", defaultValue = "true")
public boolean ENABLE_LOCAL_DOWNLOAD_DIR_IN_CLASS_PATH = true;

}
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,17 @@ public static void verifyUserConfig() throws Exception {

//
// 是否使用远程的配置
LOGGER.info("SERVER enable.remote.conf: " + DisClientConfig.getInstance().ENABLE_DISCONF);
LOGGER.info("SERVER disconf.enable.remote.conf: " + DisClientConfig.getInstance().ENABLE_DISCONF);

//
// debug mode
LOGGER.info("SERVER debug: " + DisClientConfig.getInstance().DEBUG);
LOGGER.info("SERVER disconf.debug: " + DisClientConfig.getInstance().DEBUG);

// 用户下载文件夹
if (!StringUtils.isEmpty(DisClientConfig.getInstance().userDefineDownloadDir)) {
OsUtil.makeDirs(DisClientConfig.getInstance().userDefineDownloadDir);
LOGGER.info("SERVER user_define_download_dir: " + DisClientConfig.getInstance().userDefineDownloadDir);
LOGGER.info("SERVER disconf.user_define_download_dir: " + DisClientConfig.getInstance()
.userDefineDownloadDir);
}

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ private static void autowareConfig(final Object obj, Properties prop) throws Exc

String defaultValue = config.defaultValue();
value = prop.getProperty(name, defaultValue);

// using disconf as prefix to avoid env confusion
if (value.equals(defaultValue) && name != null) {
if (name.contains("disconf.")) {
String newName = name.substring(name.indexOf('.') + 1);
value = prop.getProperty(newName, defaultValue);
}
}
}

field.setAccessible(true);
Expand Down
10 changes: 5 additions & 5 deletions disconf-client/src/main/resources/disconf_sys.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@


# \u4ED3\u5E93 URL
conf_server_store_action=/api/config
disconf.conf_server_store_action=/api/config

# zoo URL
conf_server_zoo_action=/api/zoo
disconf.conf_server_zoo_action=/api/zoo

# \u83B7\u53D6\u8FDC\u7A0B\u4E3B\u673A\u4E2A\u6570\u7684URL
conf_server_master_num_action=/api/getmasterinfo
disconf.conf_server_master_num_action=/api/getmasterinfo

# \u4E0B\u8F7D\u7684\u6587\u4EF6\u4F1A\u88AB\u8FC1\u79FB\u5230classpath\u6839\u8DEF\u5F84\u4E0B\uFF0C\u5F3A\u70C8\u5EFA\u8BAE\u5C06\u6B64\u9009\u9879\u7F6E\u4E3A true(\u9ED8\u8BA4\u662Ftrue)
enable_local_download_dir_in_class_path=true
disconf.enable_local_download_dir_in_class_path=true

# \u4E0B\u8F7D\u6587\u4EF6\u5939, \u8FDC\u7A0B\u6587\u4EF6\u4E0B\u8F7D\u540E\u4F1A\u653E\u5728\u8FD9\u91CC
local_download_dir=./disconf/download
disconf.local_download_dir=./disconf/download
20 changes: 10 additions & 10 deletions disconf-client/src/test/resources/disconf.properties
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@

# \u662F\u5426\u542F\u52A8disconf
# true(\u9ED8\u8BA4)\u4F1A\u4ECE\u8FDC\u7A0B\u83B7\u53D6\u914D\u7F6E false\u5219\u76F4\u63A5\u83B7\u53D6\u672C\u5730\u914D\u7F6E
enable.remote.conf=true
disconf.enable.remote.conf=true

#
# \u914D\u7F6E\u670D\u52A1\u5668\u7684 HOST,\u7528\u9017\u53F7\u5206\u9694 127.0.0.1:9289,127.0.0.1:9289
#
conf_server_host=127.0.0.1:9289,127.0.0.1:9289
disconf.conf_server_host=127.0.0.1:9289,127.0.0.1:9289

# \u7248\u672C, \u8BF7\u91C7\u7528 X_X_X_X \u683C\u5F0F
version=1_0_0_0
disconf.version=1_0_0_0

# APP \u8BF7\u91C7\u7528 \u4EA7\u54C1\u7EBF_\u670D\u52A1\u540D \u683C\u5F0F
app=disconf_testcase
disconf.app=disconf_testcase

# \u73AF\u5883
env=rd
disconf.env=rd

# \u8C03\u8BD5\u65F6true, \u7EBF\u4E0A\u73AF\u5883false
debug=true
disconf.debug=true

# \u5FFD\u7565\u54EA\u4E9B\u5206\u5E03\u5F0F\u914D\u7F6E\uFF0C\u7528\u9017\u53F7\u5206\u9694
ignore=ignoreB.properties,ignoreB.properties
disconf.ignore=ignoreB.properties,ignoreB.properties

# \u83B7\u53D6\u8FDC\u7A0B\u914D\u7F6E \u91CD\u8BD5\u6B21\u6570\uFF0C\u9ED8\u8BA4\u662F3\u6B21
conf_server_url_retry_times=3
disconf.conf_server_url_retry_times=3
# \u83B7\u53D6\u8FDC\u7A0B\u914D\u7F6E \u91CD\u8BD5\u65F6\u4F11\u7720\u65F6\u95F4\uFF0C\u9ED8\u8BA4\u662F5\u79D2
conf_server_url_retry_sleep_seconds=5
disconf.conf_server_url_retry_sleep_seconds=5

# \u7528\u6237\u6307\u5B9A\u7684\u4E0B\u8F7D\u6587\u4EF6\u5939, \u8FDC\u7A0B\u6587\u4EF6\u4E0B\u8F7D\u540E\u4F1A\u653E\u5728\u8FD9\u91CC
user_define_download_dir=./disconf/download
disconf.user_define_download_dir=./disconf/download
2 changes: 1 addition & 1 deletion disconf-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<groupId>com.baidu.disconf</groupId>
<artifactId>disconf-base</artifactId>
<relativePath>../</relativePath>
<version>2.6.26-SNAPSHOT</version>
<version>2.6.26</version>
</parent>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<dependency>
<groupId>com.baidu.disconf</groupId>
<artifactId>disconf-client</artifactId>
<version>2.6.26-SNAPSHOT</version>
<version>2.6.26</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# \u662F\u5426\u4F7F\u7528\u8FDC\u7A0B\u914D\u7F6E\u6587\u4EF6
# true(\u9ED8\u8BA4)\u4F1A\u4ECE\u8FDC\u7A0B\u83B7\u53D6\u914D\u7F6E false\u5219\u76F4\u63A5\u83B7\u53D6\u672C\u5730\u914D\u7F6E
enable.remote.conf=true
disconf.enable.remote.conf=true

#
# \u914D\u7F6E\u670D\u52A1\u5668\u7684 HOST,\u7528\u9017\u53F7\u5206\u9694 127.0.0.1:8000,127.0.0.1:8000
#
conf_server_host=127.0.0.1:8080
disconf.conf_server_host=127.0.0.1:8080

# \u7248\u672C, \u8BF7\u91C7\u7528 X_X_X_X \u683C\u5F0F
version=1_0_0_0
disconf.version=1_0_0_0

# APP \u8BF7\u91C7\u7528 \u4EA7\u54C1\u7EBF_\u670D\u52A1\u540D \u683C\u5F0F
app=spring-boot-disconf
disconf.app=spring-boot-disconf

# \u73AF\u5883
env=rd
disconf.env=rd

# \u5FFD\u7565\u54EA\u4E9B\u5206\u5E03\u5F0F\u914D\u7F6E\uFF0C\u7528\u9017\u53F7\u5206\u9694
ignore=
disconf.ignore=

# \u83B7\u53D6\u8FDC\u7A0B\u914D\u7F6E \u91CD\u8BD5\u6B21\u6570\uFF0C\u9ED8\u8BA4\u662F3\u6B21
conf_server_url_retry_times=1
disconf.conf_server_url_retry_times=1
# \u83B7\u53D6\u8FDC\u7A0B\u914D\u7F6E \u91CD\u8BD5\u65F6\u4F11\u7720\u65F6\u95F4\uFF0C\u9ED8\u8BA4\u662F5\u79D2
conf_server_url_retry_sleep_seconds=1
disconf.conf_server_url_retry_sleep_seconds=1
2 changes: 1 addition & 1 deletion disconf-demos/disconf-standalone-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<dependency>
<groupId>com.baidu.disconf</groupId>
<artifactId>disconf-client</artifactId>
<version>2.6.26-SNAPSHOT</version>
<version>2.6.26</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

# \u662F\u5426\u4F7F\u7528\u8FDC\u7A0B\u914D\u7F6E\u6587\u4EF6
# true(\u9ED8\u8BA4)\u4F1A\u4ECE\u8FDC\u7A0B\u83B7\u53D6\u914D\u7F6E false\u5219\u76F4\u63A5\u83B7\u53D6\u672C\u5730\u914D\u7F6E
enable.remote.conf=true
disconf.enable.remote.conf=true

#
# \u914D\u7F6E\u670D\u52A1\u5668\u7684 HOST,\u7528\u9017\u53F7\u5206\u9694 127.0.0.1:8000,127.0.0.1:8000
#
conf_server_host=127.0.0.1:8080
disconf.conf_server_host=127.0.0.1:8080

# \u7248\u672C, \u8BF7\u91C7\u7528 X_X_X_X \u683C\u5F0F
version=1_0_0_0
disconf.version=1_0_0_0

# APP \u8BF7\u91C7\u7528 \u4EA7\u54C1\u7EBF_\u670D\u52A1\u540D \u683C\u5F0F
app=disconf_demo
disconf.app=disconf_demo

# \u73AF\u5883
env=rd
disconf.env=rd

# \u5FFD\u7565\u54EA\u4E9B\u5206\u5E03\u5F0F\u914D\u7F6E\uFF0C\u7528\u9017\u53F7\u5206\u9694
ignore=
disconf.ignore=

# \u83B7\u53D6\u8FDC\u7A0B\u914D\u7F6E \u91CD\u8BD5\u6B21\u6570\uFF0C\u9ED8\u8BA4\u662F3\u6B21
conf_server_url_retry_times=1
disconf.conf_server_url_retry_times=1
# \u83B7\u53D6\u8FDC\u7A0B\u914D\u7F6E \u91CD\u8BD5\u65F6\u4F11\u7720\u65F6\u95F4\uFF0C\u9ED8\u8BA4\u662F5\u79D2
conf_server_url_retry_sleep_seconds=1
disconf.conf_server_url_retry_sleep_seconds=1

# \u7528\u6237\u6307\u5B9A\u7684\u4E0B\u8F7D\u6587\u4EF6\u5939, \u8FDC\u7A0B\u6587\u4EF6\u4E0B\u8F7D\u540E\u4F1A\u653E\u5728\u8FD9\u91CC
user_define_download_dir=./disconf/download2
disconf.user_define_download_dir=./disconf/download2
Loading

0 comments on commit 2aaf272

Please sign in to comment.