在 akka 配置中重用变量
Reuse variables in akka config
如何在其他几个属性中重复使用配置 属性?我简化的真实示例如下所示:
myApp {
host = "www.myfoohost.com"
urls {
url1 = host + "/b" // this...
url2 = host + "/a" // ... and this do not work
}
}
在 Typesafe Config 中称为 substitutions,它使用 ${}
表示法:
myApp {
host = "www.myfoohost.com"
urls {
url1 = ${myApp.host}"/b"
url2 = ${myApp.host}"/a"
}
}
如何在其他几个属性中重复使用配置 属性?我简化的真实示例如下所示:
myApp {
host = "www.myfoohost.com"
urls {
url1 = host + "/b" // this...
url2 = host + "/a" // ... and this do not work
}
}
在 Typesafe Config 中称为 substitutions,它使用 ${}
表示法:
myApp {
host = "www.myfoohost.com"
urls {
url1 = ${myApp.host}"/b"
url2 = ${myApp.host}"/a"
}
}