@Value和@ConfigurationProperties

1.@Value用法

https://blog.csdn.net/u010832551/article/details/73826914

2.@ConfigurationProperties用法

https://www.jianshu.com/p/7f75936b573b

3.最近看到的一个新的用法:

@Bean("kafakConsumerProp")
@ConfigurationProperties(prefix="kafka.consumer.properties")
public Properties getKafkaConsumerProperties() {
return new Properties();
}

直接注入进Properties对象

posted on 2019-10-31 19:30  木西-Muxy  阅读(323)  评论(0编辑  收藏  举报

导航