knightliao/disconf

多个同质配置disconf该如何处理?

Open

#113 opened on Jun 15, 2016

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Java (2,321 forks)batch import
help wanted

Repository metrics

Stars
 (5,573 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

例如我司数据库配置如下: ------dbs.properties-------- dbs.user.url=192.168.28.1/..... dbs.user.username=? dbs.user.password=?

dbs.order.url=192.168.28.2/..... dbs.order.username=? dbs.order.password=? ---------end---------------- 如果用disconf的默认形式那么配置应该是这样的 -------dbsConf.class-------- DisconfFileItem("dbs.user.url") private String getUserDbUrl(); DisconfFileItem("dbs.order.url") private String getOrderDbUrl(); .... ---------end---------------- 但用上述处理方案,新添加一个数据库就很麻烦了,是否能有更简便的方案? 注意到您的源码中有个DisconfCenterFile.additionalKeyMaps,原本以为能发挥类似Spring4的PropertySource机制中Enviroment的作用,但不清楚该如何使用

Contributor guide