![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
文章平均质量分 55
lyt644235661
个性开朗
展开
-
Apollo 配置中心使用@ConfigurationProperties,配置实时更新失败
1. 使用@value 注解,配置实时更新,使用@ConfigurationProperties 注解配置无实时更新 2.添加监听配置,配置还没有实时更新 @Configuration public class ConfigRefresh { @Autowired private ApplicationContext cxt; @ApolloConfigChangeListener public void onChange(ConfigChangeEvent eve原创 2021-10-14 16:09:48 · 2477 阅读 · 0 评论 -
springboot 1.5.2 自定义的配置文件加载
在类名添加@PropertySource注解 ,指定配置文件的地址 @ConfigurationProperties 指定properties 里的前缀 @Configuration @PropertySource(value="classpath:data.properties") public class DataSourceConfig { @Bean(name = "prim原创 2017-04-27 11:52:01 · 340 阅读 · 0 评论