最新文章

ConfigurationProperties到底需不需要getter

ConfigurationProperties到底需不需要getter

为什么要讨论这个问题, 工作中一个同事写的类使用了ConfigurationProperties, 只提供了标准的setter方法. 属性的访问, 提供了定制的方法. 可以参考EurekaClientConfigBean. 他使用的是spring boot 2.0.0.M5版本, 可以正常获取配置文件中的属性值, 但是在1.5.8.RELEASE获取不到. 看下文档和源码: Annotation for externalized configuration. Add this to a class definition or a @Bean method in a @Configuration class if you want to bind and validate some external Properties (e.

About Me

张晓辉

英文名 Addo。 资深程序员,LF APAC 开源布道师,CNCF Ambassador,云原生社区管委会成员,公众号“云原生指北”作者,微软 Azure MVP。 曾任职于汇丰软件、唯品会、数人云、小鹏汽车,有多年的微服务和基础架构实践经验,主要工作涉及微服务、容 …

进一步了解