code2life / spring-boot-dynamic-config Goto Github PK
View Code? Open in Web Editor NEWDynamic Configuration Capability for SpringBoot Application
License: Apache License 2.0
Dynamic Configuration Capability for SpringBoot Application
License: Apache License 2.0
如题,老项目不是boot,可以支持么
没有达到动图的效果,也没有改example的代码,用f12查看了请求,每次获取的还是启动前的值,我是哪一步出了问题。。
如题
windows里无法运行吗,那个配置文件路径我不管填绝对还是相对都报错,java.nio.file.NotDirectoryException
配置方式
@RestController
public class CommonSearchController {
@Value("${test.config:China}")
private String configStr;
@GetMapping("/test")
public RestResponse<String> test() {
return RestResponse.success(configStr);
}
}
实际调试及运行时无法做到配置项自动更改。
经调试查询,发现在DynamicConfigBeanPostProcessor类的postProcessAfterInitialization方法中获得的入参bean是被cglib代理的对象,因此,field.set方法是设置对应属性值在代理对象上,而在接口被调用时是取的是被代理对象上的属性,因此无效。
建议支持直接从git读取配置,而不依赖k8s,大部分公司的实例并没有多到使用k8s的地步,而且小公司并不会使用
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.