@ConfigurationProperties should have an option to have properties read each time from Environment
See original GitHub issueOriginally raised on the SPR issue tracker: https://jira.springsource.org/browse/SPR-11289
@ConfigurationProperties
objects should have some mechanism for allowing some or all properties to be read from a propertySource on each get invocation. It seems like instead of injected a concrete implementation into the AppContext we should inject a proxy for the Config object which can reference the Environment abstraction.
The usecase for this would be when we have implemented a custom PropertySource which is aware of property changes.
Issue Analytics
- State:
- Created 10 years ago
- Reactions:1
- Comments:19 (9 by maintainers)
Top Results From Across the Web
24. Externalized Configuration - Spring
Spring Boot lets you externalize your configuration so that you can work with the same application code in different environments. You can use...
Read more >Guide to @ConfigurationProperties in Spring Boot - Baeldung
A quick and practical guide to @ConfigurationProperties annotation in Spring Boot.
Read more >Configuring a Spring Boot Module with ... - Reflectoring
Using @ConfigurationProperties to Configure a Module · The prefix defines which external properties will be bound to the fields of the class.
Read more >Spring Boot @ConfigurationProperties example - Mkyong.com
Spring Boot @ConfigurationProperties is letting developer maps the entire .properties and yml file into an object easily. P.S Tested with ...
Read more >Spring Boot Configuration Properties
Introduction · 1. application.properties File. · 2. Setting up Application · 3. Property Injection Using @Value Annotation · 4. Using @ ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
FYI
spring-cloud-config
isn’t needed for@RefreshScope
, and also@RefreshScope
is not needed for@ConfigurationProperties
. Just putspring-cloud-commons
on the classpath - it’s very lightweight, really - the only dependency is Spring Boot.Hi @philwebb @dsyer @wilkinsona,
I think the original feature this issue requests have been implemented in my project: https://github.com/Code2Life/spring-boot-dynamic-config
Adding
@DynamicConfig
on@ConfigurationProperties
simply works !With Spring Boot native features leveraged, and with the file watcher and hot-reload mechanism implemented by only 400+ lines of code,
@Value
@ConfigurationProperties
could always be the newest value.This lib is widely used in 20+ core applications for more than half a year in the company I’m working for. Hope this feature becomes a built-in feature of Spring Boot. @philwebb @dsyer @wilkinsona Would you like to take a look at the source codes and put some suggestions? Thanks !