「 SPRINGCLOUD篇 」 十一月 05, 2021
SpringCloud --- Nacos ConfigurationProperties 配置类自动刷新简记
文章字数 2.1k 阅读约需 2 mins.
使用 @ConfigurationProperties(prefix = "xxxx")
注解配置类
在 Nacos 配置中心里修改相应的配置会自动的刷新属性(配置类上不需要注解 @RefreshScope)
还可以通过发送 POST 请求手动刷新 /actuator/refresh 配置
修改保存后会发现日志打印出如下内容:
2021-09-29 01:02:22.081 INFO [etc-gateway,,] 2664 --- [xxx_6101] c.a.n.client...
查看全文