【发布时间】:2020-05-02 21:00:14
【问题描述】:
//This is the value of the property which needs to be fetched via config server from git repo
ConfigClientController(@Value("**${foo:test}"**) String value) {
this.value = value;
}
上面的代码是一个spring cloud config客户端(spring.application.name=foo),它从git config repo获取配置属性。 Foo 是 foo.properties 中的属性。在这里,我对上面代码中的 :test 参数有点困惑。我想知道这个参数对于获取属性有什么意义。
【问题讨论】:
标签: spring spring-boot-configuration