Files
kenaito-conf/kenaito-conf-springboot2-client-demo
odboy c2e599097e feat(springboot3): 添加 RefreshScope 自动配置支持
- 新增 KenaitoRefreshAutoConfiguration 类,实现 ApplicationContextAware
- 更新 spring.factories,注册 EnableAutoConfiguration
- 与 Spring Boot 2 客户端保持一致,支持 @Value 和 @ConfigurationProperties 动态刷新
2026-03-23 21:04:15 +08:00
..
2026-01-14 21:02:13 +08:00

kenaito-conf-springboot2-client-demo

配置中心客户端示例项目。

配置说明

在 application.properties 中配置:

# 配置中心地址
kenaito.config.server=http://localhost:8080
kenaito.config.appName=demo
kenaito.config.env=dev
kenaito.config.version=latest
kenaito.config.profile=dev

运行步骤

  1. 先安装 kenaito-conf-springboot2-client 到本地 Maven 仓库:
cd E:\SelfDev\Gitea2026\kenaito-conf\kenaito-conf-springboot2-client
mvn clean install -DskipTests
  1. 运行示例项目:
cd E:\SelfDev\Gitea2026\kenaito-springboot-demo
mvn spring-boot:run
  1. 访问测试:
curl http://localhost:8081/

配置优先级

远程配置 > 本地配置

在配置中心添加应用 demo 的配置后,远程配置会覆盖本地同名配置。