Closed
Description
SpringBoot version - 1.5.10.RELEASE
I'm using Spring Centralized Configuration to store my application configuration and it works fine for single valued properties but for MultiValued properties remote config is not able to override local properties.
remote config file: test-cloud-config.yml
test:
empty:
strKey:
listKey: []
SpringBoot resource local: application.yml
test:
empty:
strKey: local str Key
listKey: localOne, localTwo
My spring boot class:-
@Component
public class TestRemoteConfig {
@Value("${test.empty.strKey}")
private String testEmptyStrKey;
@Value("${test.empty.listKey}")
private String[] testEmptyListKey;
@PostConstruct
public void init(){
System.out.println("Test override EmptyStrKey's value :- "+ testEmptyStrKey);
System.out.println("Test override EmptyListKey's value :- "+ Arrays.asList(testEmptyListKey));
}
}
Output
Test override EmptyStrKey's value :-
Test override EmptyListKey's value :- [localOne, localTwo]
but I expect 'testEmptyListKey' to be empty.
Note: This works when I use .properties in place of .yml as config file