├── .gitignore
├── Dockerfile
├── LICENSE
├── README.md
├── configcenter-assemble
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── antframework
│ │ └── configcenter
│ │ └── Main.java
│ └── resources
│ ├── application-dev.properties
│ └── application.properties
├── configcenter-biz
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── antframework
│ └── configcenter
│ └── biz
│ ├── BizConfiguration.java
│ ├── converter
│ └── BranchConverter.java
│ ├── provider
│ ├── AppServiceProvider.java
│ ├── BranchRuleServiceProvider.java
│ ├── BranchServiceProvider.java
│ ├── ConfigServiceProvider.java
│ ├── ProfileServiceProvider.java
│ ├── PropertyKeyServiceProvider.java
│ ├── PropertyValueServiceProvider.java
│ ├── RefreshServiceProvider.java
│ └── ReleaseServiceProvider.java
│ ├── service
│ ├── AddBranchService.java
│ ├── AddOrModifyAppService.java
│ ├── AddOrModifyBranchRuleService.java
│ ├── AddOrModifyProfileService.java
│ ├── AddOrModifyPropertyKeyService.java
│ ├── AddOrModifyPropertyValueService.java
│ ├── ComputeBranchMergenceService.java
│ ├── ComputeBranchRulesService.java
│ ├── DeleteAppService.java
│ ├── DeleteBranchRuleService.java
│ ├── DeleteBranchService.java
│ ├── DeleteProfileService.java
│ ├── DeletePropertyKeyService.java
│ ├── DeletePropertyValueService.java
│ ├── FindAppService.java
│ ├── FindAppTreeService.java
│ ├── FindBranchRulesService.java
│ ├── FindBranchService.java
│ ├── FindBranchesService.java
│ ├── FindConfigService.java
│ ├── FindInheritedAppPropertyKeysService.java
│ ├── FindInheritedAppReleasesService.java
│ ├── FindInheritedAppsService.java
│ ├── FindInheritedProfilesService.java
│ ├── FindProfileService.java
│ ├── FindProfileTreeService.java
│ ├── FindPropertyKeysService.java
│ ├── FindPropertyValuesService.java
│ ├── FindReleaseService.java
│ ├── MergeBranchService.java
│ ├── ProduceReleaseVersionService.java
│ ├── RefreshClientsService.java
│ ├── ReleaseBranchService.java
│ ├── RevertBranchService.java
│ └── RevertPropertyValuesService.java
│ └── util
│ ├── Apps.java
│ ├── BranchRules.java
│ ├── Branches.java
│ ├── Configs.java
│ ├── Profiles.java
│ ├── Properties.java
│ ├── PropertyKeys.java
│ ├── PropertyValues.java
│ ├── QueryUtils.java
│ ├── Refreshes.java
│ └── Releases.java
├── configcenter-client
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── antframework
│ └── configcenter
│ └── client
│ ├── Config.java
│ ├── ConfigContext.java
│ ├── ConfigListener.java
│ ├── core
│ ├── ChangedProperty.java
│ ├── ConfigProperties.java
│ ├── ConfigurableConfigProperties.java
│ └── DefaultConfigProperties.java
│ └── support
│ ├── ConfigListeners.java
│ ├── ConfigRefresher.java
│ ├── ServerListener.java
│ ├── ServerRequester.java
│ └── TaskExecutor.java
├── configcenter-common
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── antframework
│ └── configcenter
│ └── common
│ └── constant
│ └── CacheConstant.java
├── configcenter-dal
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── antframework
│ └── configcenter
│ └── dal
│ ├── DalConfiguration.java
│ ├── dao
│ ├── AppDao.java
│ ├── BranchDao.java
│ ├── BranchRuleDao.java
│ ├── MergenceDao.java
│ ├── ProfileDao.java
│ ├── PropertyKeyDao.java
│ ├── PropertyValueDao.java
│ └── ReleaseDao.java
│ └── entity
│ ├── App.java
│ ├── Branch.java
│ ├── BranchRule.java
│ ├── Mergence.java
│ ├── Profile.java
│ ├── PropertyKey.java
│ ├── PropertyValue.java
│ └── Release.java
├── configcenter-facade
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── antframework
│ └── configcenter
│ └── facade
│ ├── api
│ ├── AppService.java
│ ├── BranchRuleService.java
│ ├── BranchService.java
│ ├── ConfigService.java
│ ├── ProfileService.java
│ ├── PropertyKeyService.java
│ ├── PropertyValueService.java
│ ├── RefreshService.java
│ └── ReleaseService.java
│ ├── info
│ ├── AppInfo.java
│ ├── AppPropertyKey.java
│ ├── AppRelease.java
│ ├── AppTree.java
│ ├── BranchInfo.java
│ ├── BranchRuleInfo.java
│ ├── ProfileInfo.java
│ ├── ProfileTree.java
│ ├── PropertyChange.java
│ ├── PropertyDifference.java
│ ├── PropertyKeyInfo.java
│ ├── PropertyValueInfo.java
│ └── ReleaseInfo.java
│ ├── order
│ ├── AddBranchOrder.java
│ ├── AddOrModifyAppOrder.java
│ ├── AddOrModifyBranchRuleOrder.java
│ ├── AddOrModifyProfileOrder.java
│ ├── AddOrModifyPropertyKeyOrder.java
│ ├── AddOrModifyPropertyValueOrder.java
│ ├── ComputeBranchMergenceOrder.java
│ ├── ComputeBranchRulesOrder.java
│ ├── DeleteAppOrder.java
│ ├── DeleteBranchOrder.java
│ ├── DeleteBranchRuleOrder.java
│ ├── DeleteProfileOrder.java
│ ├── DeletePropertyKeyOrder.java
│ ├── DeletePropertyValueOrder.java
│ ├── FindAppOrder.java
│ ├── FindAppTreeOrder.java
│ ├── FindBranchOrder.java
│ ├── FindBranchRulesOrder.java
│ ├── FindBranchesOrder.java
│ ├── FindConfigOrder.java
│ ├── FindInheritedAppPropertyKeysOrder.java
│ ├── FindInheritedAppReleasesOrder.java
│ ├── FindInheritedAppsOrder.java
│ ├── FindInheritedProfilesOrder.java
│ ├── FindProfileOrder.java
│ ├── FindProfileTreeOrder.java
│ ├── FindPropertyKeysOrder.java
│ ├── FindPropertyValuesOrder.java
│ ├── FindReleaseOrder.java
│ ├── MergeBranchOrder.java
│ ├── ProduceReleaseVersionOrder.java
│ ├── QueryAppsOrder.java
│ ├── QueryProfilesOrder.java
│ ├── QueryReleasesOrder.java
│ ├── RefreshClientsOrder.java
│ ├── ReleaseBranchOrder.java
│ ├── ReleaseBranchResult.java
│ ├── RevertBranchOrder.java
│ └── RevertPropertyValuesOrder.java
│ ├── result
│ ├── ComputeBranchMergenceResult.java
│ ├── ComputeBranchRulesResult.java
│ ├── FindAppResult.java
│ ├── FindAppTreeResult.java
│ ├── FindBranchResult.java
│ ├── FindBranchRulesResult.java
│ ├── FindBranchesResult.java
│ ├── FindConfigResult.java
│ ├── FindInheritedAppPropertyKeysResult.java
│ ├── FindInheritedAppReleasesResult.java
│ ├── FindInheritedAppsResult.java
│ ├── FindInheritedProfilesResult.java
│ ├── FindProfileResult.java
│ ├── FindProfileTreeResult.java
│ ├── FindPropertyKeysResult.java
│ ├── FindPropertyValuesResult.java
│ ├── FindReleaseResult.java
│ ├── MergeBranchResult.java
│ ├── ProduceReleaseVersionResult.java
│ ├── QueryAppsResult.java
│ ├── QueryProfilesResult.java
│ └── QueryReleasesResult.java
│ └── vo
│ ├── BranchConstants.java
│ ├── ConfigTopic.java
│ ├── Property.java
│ ├── RedisConstant.java
│ ├── RefreshClientsEvent.java
│ ├── ReleaseConstant.java
│ ├── ResultCode.java
│ └── Scope.java
├── configcenter-spring-boot-starter
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── antframework
│ │ └── configcenter
│ │ └── spring
│ │ ├── ConfigContexts.java
│ │ └── boot
│ │ ├── ConfigContextLifeCycle.java
│ │ ├── ConfigcenterProperties.java
│ │ └── EnvironmentInitializer.java
│ └── resources
│ └── META-INF
│ ├── additional-spring-configuration-metadata.json
│ └── spring.factories
├── configcenter-test
├── pom.xml
└── src
│ └── test
│ └── java
│ └── org
│ └── antframework
│ └── configcenter
│ └── test
│ ├── AbstractTest.java
│ ├── client
│ └── ConfigContextTest.java
│ └── facade
│ └── api
│ ├── AppServiceTest.java
│ ├── BranchRuleServiceTest.java
│ ├── BranchServiceTest.java
│ ├── ConfigServiceTest.java
│ ├── ProfileServiceTest.java
│ ├── PropertyKeyServiceTest.java
│ ├── PropertyValueServiceTest.java
│ ├── RefreshServiceTest.java
│ └── ReleaseServiceTest.java
├── configcenter-web
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── antframework
│ │ └── configcenter
│ │ └── web
│ │ ├── WebConfiguration.java
│ │ ├── common
│ │ ├── AppPropertyTypes.java
│ │ ├── GlobalExceptionHandler.java
│ │ ├── ListeningClientsContainer.java
│ │ ├── ManagerApps.java
│ │ └── PropertyType.java
│ │ └── controller
│ │ ├── ConfigController.java
│ │ └── manage
│ │ ├── AppController.java
│ │ ├── BranchController.java
│ │ ├── BranchRuleController.java
│ │ ├── ProfileController.java
│ │ ├── PropertyKeyController.java
│ │ ├── PropertyTypeController.java
│ │ ├── PropertyValueController.java
│ │ ├── RefreshController.java
│ │ └── ReleaseController.java
│ └── resources
│ └── static
│ ├── common
│ ├── common.js
│ └── import.js
│ ├── components
│ ├── Apps.html
│ ├── Apps.js
│ ├── Branches.html
│ ├── Branches.js
│ ├── Configs.html
│ ├── Configs.js
│ ├── ManagerApps.html
│ ├── ManagerApps.js
│ ├── Profiles.html
│ ├── Profiles.js
│ ├── PropertyKeys.html
│ ├── PropertyKeys.js
│ ├── PropertyTypes.html
│ ├── PropertyTypes.js
│ ├── PropertyValues.html
│ ├── PropertyValues.js
│ ├── Releases.html
│ └── Releases.js
│ ├── favicon.ico
│ ├── html
│ ├── initAdmin.html
│ ├── login.html
│ └── main.html
│ ├── index.html
│ └── lib
│ └── icon
│ ├── demo.css
│ ├── demo_fontclass.html
│ ├── demo_symbol.html
│ ├── demo_unicode.html
│ ├── iconfont.css
│ ├── iconfont.eot
│ ├── iconfont.js
│ ├── iconfont.svg
│ ├── iconfont.ttf
│ └── iconfont.woff
└── pom.xml
/.gitignore:
--------------------------------------------------------------------------------
1 | # maven ignore
2 | target/
3 | *.jar
4 | *.war
5 | *.zip
6 | *.tar
7 | *.tar.gz
8 |
9 | # eclipse ignore
10 | .settings/
11 | .project
12 | .classpath
13 |
14 | # idea ignore
15 | .idea/
16 | *.ipr
17 | *.iml
18 | *.iws
19 |
20 | # temp ignore
21 | *.log
22 | *.cache
23 | *.diff
24 | *.patch
25 | *.tmp
26 |
27 | # system ignore
28 | .DS_Store
29 | Thumbs.db
30 |
31 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM store/oracle/serverjre:8
2 | COPY /configcenter-assemble/target/configcenter-exec.jar /apps/configcenter/configcenter-exec.jar
3 | VOLUME /var/apps
4 | EXPOSE 6220
5 | ENV JAVA_OPTS=""
6 | ENTRYPOINT java $JAVA_OPTS -jar /apps/configcenter/configcenter-exec.jar
7 |
--------------------------------------------------------------------------------
/configcenter-assemble/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.antframework.configcenter
7 | configcenter
8 | 1.7.3
9 |
10 |
11 | configcenter-assemble
12 |
13 |
14 |
15 | true
16 |
17 |
18 |
19 |
20 | org.antframework.configcenter
21 | configcenter-web
22 | ${project.parent.version}
23 |
24 |
25 | org.antframework.boot
26 | ant-boot-starter-lang
27 |
28 |
29 | org.antframework.boot
30 | ant-boot-starter-logging
31 |
32 |
33 |
34 |
35 | configcenter
36 |
37 |
38 |
39 | org.springframework.boot
40 | spring-boot-maven-plugin
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/configcenter-assemble/src/main/java/org/antframework/configcenter/Main.java:
--------------------------------------------------------------------------------
1 | /*
2 | * 作者:钟勋 (e-mail:zhongxunking@163.com)
3 | */
4 |
5 | /*
6 | * 修订记录:
7 | * @author 钟勋 2017-08-22 15:48 创建
8 | */
9 | package org.antframework.configcenter;
10 |
11 | import org.antframework.boot.lang.AntBootApplication;
12 | import org.antframework.boot.lang.Apps;
13 | import org.springframework.boot.SpringApplication;
14 |
15 | /**
16 | * 程序启动入口
17 | */
18 | @AntBootApplication(appId = "configcenter")
19 | public class Main {
20 | public static void main(String[] args) {
21 | Apps.setProfileIfAbsent("dev");
22 | SpringApplication.run(Main.class, args);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/configcenter-assemble/src/main/resources/application-dev.properties:
--------------------------------------------------------------------------------
1 | #\u6570\u636E\u5E93
2 | spring.datasource.url=jdbc:mysql://localhost:3306/configcenter_online?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
3 | spring.datasource.username=root
4 | spring.datasource.password=root
5 | #spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/configcenter_online?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
6 | #spring.datasource.username=postgres
7 | #spring.datasource.password=12345678
8 | #JPA
9 | spring.jpa.hibernate.ddl-auto=update
10 | #Redis
11 | spring.redis.host=localhost
12 | spring.redis.port=6379
13 | spring.redis.password=123
14 | #\u83B7\u53D6\u914D\u7F6E\u662F\u9700\u8981\u7BA1\u7406\u5458\u8BA4\u8BC1
15 | #configcenter.config.fetch-need-manager=true
16 |
--------------------------------------------------------------------------------
/configcenter-assemble/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | #\u7AEF\u53E3
2 | server.port=6220
3 | #\u6570\u636E\u5E93
4 | spring.datasource.hikari.auto-commit=false
5 | #\u7F13\u5B58
6 | spring.cache.type=redis
7 | spring.cache.redis.time-to-live=5m
8 | #Session
9 | spring.session.store-type=redis
10 |
--------------------------------------------------------------------------------
/configcenter-biz/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.antframework.configcenter
7 | configcenter
8 | 1.7.3
9 |
10 |
11 | configcenter-biz
12 |
13 |
14 |
15 | true
16 |
17 |
18 |
19 |
20 | org.antframework.configcenter
21 | configcenter-facade
22 | ${project.parent.version}
23 |
24 |
25 | org.antframework.configcenter
26 | configcenter-dal
27 | ${project.parent.version}
28 |
29 |
30 | org.antframework.boot
31 | ant-boot-starter-bekit
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter-data-redis
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/configcenter-biz/src/main/java/org/antframework/configcenter/biz/BizConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * 作者:钟勋 (e-mail:zhongxunking@163.com)
3 | */
4 |
5 | /*
6 | * 修订记录:
7 | * @author 钟勋 2017-08-22 15:42 创建
8 | */
9 | package org.antframework.configcenter.biz;
10 |
11 | import lombok.AllArgsConstructor;
12 | import lombok.extern.slf4j.Slf4j;
13 | import org.antframework.configcenter.facade.vo.RedisConstant;
14 | import org.antframework.configcenter.facade.vo.RefreshClientsEvent;
15 | import org.bekit.event.EventPublisher;
16 | import org.springframework.context.annotation.Bean;
17 | import org.springframework.context.annotation.Configuration;
18 | import org.springframework.data.redis.connection.Message;
19 | import org.springframework.data.redis.connection.MessageListener;
20 | import org.springframework.data.redis.connection.RedisConnectionFactory;
21 | import org.springframework.data.redis.core.RedisTemplate;
22 | import org.springframework.data.redis.listener.ChannelTopic;
23 | import org.springframework.data.redis.listener.RedisMessageListenerContainer;
24 |
25 | /**
26 | * biz层配置
27 | */
28 | @Configuration
29 | @AllArgsConstructor
30 | @Slf4j
31 | public class BizConfiguration {
32 | // redis操作类
33 | private final RedisTemplate