spring-boot icon indicating copy to clipboard operation
spring-boot copied to clipboard

Issue when java.util.List is used in @ConfigurationProperties and @RefreshScope

Open deepzGitHub opened this issue 11 years ago • 2 comments

Hi spring could team,

I've encountered a problem when a list of values from yml file is mapped to java.util.List in a bean which is @ConfigurationProperties and @RefreshScope.

This issue is when the list values in yml changes and /refresh is done on the client. New additions and changes to existing entries in list works fine when refreshed but if an entry is removed from yml list - it is never getting updated in the bean property on refresh.

config yml

test:
configurationProperties:
myList:
- value1
- value2
- value3

Java Bean

@ConfigurationProperties(prefix="test.configurationProperties")
@RefreshScope
public class ConfigReader {
private List myList;

When value3 is removed from the yml file and /refresh is posted, myList will still have values value1, value2, value3

Thanks

deepzGitHub avatar Jul 08 '15 16:07 deepzGitHub

Since admittedly you need to reach out to the Spring Cloud team, please raise an issue in their project instead. Probably here or here

snicoll avatar Jul 08 '15 16:07 snicoll

Done, Thanks! Adding the issue for reference https://github.com/spring-cloud/spring-cloud-config/issues/183

deepzGitHub avatar Jul 08 '15 17:07 deepzGitHub