Tencent / spring-cloud-tencent

Spring Cloud Tencent is a Spring Cloud based Service Governance Framework provided by Tencent.
Other
3.14k stars 492 forks source link

配置中心,动态刷新能力只有在第一次修改配置时触发 #1305

Closed itfsw closed 2 weeks ago

itfsw commented 1 month ago

Describe the bug 配置中心,动态刷新能力只有在第一次修改配置时触发

To Reproduce 为了防止是自己项目配置问题,clone项目spring-cloud-tencent使用了polaris-config-data-example进行了复现;

  1. 启动项目,修改teacher.name,观察到日志中正确触发了刷新,同时使用/person接口验证正确更新了bean;
  2. 再次修改teacher.name,无法触发刷新;

Expected behavior 每次修改能正确触发动态刷新能力;

Environment

SkyeBeFreeman commented 4 weeks ago

@itfsw 使用quickstart-examples试一下呢?https://github.com/Tencent/spring-cloud-tencent/tree/2022.0/spring-cloud-tencent-examples/quickstart-example

SkyeBeFreeman commented 4 weeks ago

或者(选一): 1、Person类添加@RefreshScope注解; 2、ConfigController类删除@RefreshScope注解。

chuntaojun commented 4 weeks ago

如果服务端使用时 1.18.0 的话,会存在这个 bug,可以把 server 换成这个:https://github.com/polarismesh/polaris/releases/tag/v1.18.1-alpha.0