![](/img/trans.png)
[英]Spring Cloud Config- Decryption of properties is not working on Client Side
[英]spring cloud config client config refresh not working
使用spring cloud config client时,我尝试通过update application.properites文件更新我的应用程序配置。 但这行不通。
我已经尝试了什么:更新配置文件,并提交到git;
有人知道发生了什么吗? 我尝试对其进行测试,以产生如下所示的控制器字符串值:
@Value("${my-name}")
private String name;
我已经在客户端配置中添加了@RefreshScope; 我错过了什么 ?
我终于上班了为什么。 它没有用,因为我将@RefreshScope放在错误的位置。 如果我们希望它能够正常工作,则需要将@RefreshScope放置到要更新value的配置类中。 因此,就我而言,我需要将其放置在使用该bean值的Controller类中。
@RefreshScope
public class ClientController {
@Value("${my-name}")
private String name;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.