nacos @NacosValue注解相关

Created on 30 Jun 2020  ·  4Comments  ·  Source: alibaba/nacos

@NacosValue This annotation reads the content of the configuration file, and has a lower priority than the yaml file in the springboot project. Is this involved?
Because I want to set the default value for the environment variable, but I don't want to set it in this way:
@NacosValue(value = "${xyzs:abcd}") Is there a better way to use colon splicing? Wait online...

areConfig kinquestion

All 4 comments

@NacosValue 该注解读取配置文件内容,优先级低于 springboot 项目中的 yaml 文件,是设计如此吗?
因为我要给环境变量设置默认值,但是不想使用这样的方式设置:
@NacosValue(value = "${xyzs:abcd}") 使用冒号拼接,有更好的方式吗?线上等…………

你使用的是那个依赖

你使用的是那个依赖

使用的是
compile group: 'com.alibaba.boot', name: 'nacos-config-spring-boot-starter', version: '0.2.7'

Was this page helpful?
0 / 5 - 0 ratings