先解释下为什么突然断更半个月:
千阳ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18980820575(备注:SSL证书合作)期待与您的合作!
总之,2019开局很不顺利……Anyway,今天开工,今天恢复更新。
依赖中有spring-boot-starter-actuator
添加如下配置,暴露/actuator/refresh
端点:
management:
endpoints:
web:
exposure:
include: refresh
待刷新的配置属性所在的类上添加了@RefreshScope
注解 ,例如:
@RestController
@RefreshScope
public class ConfigClientController {
@Value("${profile}")
private String profile;
@GetMapping("/profile")
public String hello() {
return this.profile;
}
}
这样,修改profile
配置后,只需向应用的/actuator/refresh
端点发送POST请求,即可刷新该属性。例如:
curl -X POST http://localhost:8081/actuator/refresh
参考文档:<http://www.itmuch.com/spring-cloud/spring-cloud-bus-auto-refresh-configuration/>
引入Cloud Bus后,就会多一个/actuator/bus-refresh
端点
<http://www.itmuch.com/spring-cloud/finchley-22/>
网页名称:跟我学SpringCloud(Finchley版)-22-配置动态刷新
浏览路径:https://www.cdcxhl.com/article14/jghjde.html
成都网站建设公司_创新互联,为您提供网站排名、移动网站建设、标签优化、网站维护、云服务器、建站公司
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联