I have multiple host values according to different markets how to fetch all those in spring-boot to create a bean. I have tried with
@value("#{${app.host}}")
private String[] host;
consul values
app:
host:
hostone: 'localhost:8080'
hosttwo: 'abc:8089'