【发布时间】:2020-07-27 08:57:02
【问题描述】:
我在 Spring Boot 微服务应用程序中通过 Spring Cloud Config Server 加载了以下配置:
{
"routes": {
"list": [
{
"a": "a1",
"b": "b1"
},
{
"a": "a2",
"b": "b2"
}
]
}
}
在我的客户端 Spring Boot 应用程序中,我有以下将配置映射到对象:
@Component
@ConfigurationProperties( prefix = "routes" )
public class MyClass
{
private List<MyDest> list = new ArrayList<>();
.
.
现在我正在尝试加载更多具有上述完全相同结构的配置(文件),但是我想将它们聚合到上面列出的“列表”对象下的同一个类中。
我该如何实现?
【问题讨论】:
标签: spring-boot spring-cloud-config