I\'m using Spring Boot and have two very similar services which I\'d like to configure in my application.yml.
The configuration looks roughly like this:
The @ConfigurationProperties anotation has the field to set prefix configulation. Here is my example:
@Component
@ConfigurationProperties(prefix = "b2gconfig")
public class B2GConfigBean {
private String account;
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
private String key;
}
And my application.properties file: