# sc-config-client **Repository Path**: scc20516/sc-config-client ## Basic Information - **Project Name**: sc-config-client - **Description**: 结合sc-config-test来测试。test中repo为配置文件 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2016-12-27 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 结合sc-config-test来测试。test中repo为配置文件 spring.application.name:对应前配置文件中的{application}部分,如果自定义一个会出错 spring.cloud.config.profile:对应前配置文件中的{profile}部分 spring.cloud.config.label:对应前配置文件的git分支 spring.cloud.config.uri:配置中心的地址 上面这些属性必须配置在bootstrap.properties中,config部分内容才能被正确加载。因为config的相关配置会先于application.properties,而bootstrap.properties的加载也是先于application.properties。 配置内容的实时更新需要依赖spring-boot-starter-actuator org.springframework.boot spring-boot-starter-actuator 其中包含了/refresh刷新API,只支持post请求,在chrome中安装postman来发送 POST请求即可。 ------------------------------------------------------------------------------------------------------------------- 第二部分,结合spring-cloud-starter-bus-amqp来完成实时更新 git中更新配置后,刷新/bus/refresh,更新bus线上任意一个实例的配置,客户端即可获取最新配置 优点: 将sc-config-server加入到消息总线中,git更新后,直接刷新server的/bus/refresh请求,不再操作任意一个实例,降低维护的复杂度。