Now we can't create the dynamic application.properties or application.yml keys.
For example, I want to declare testapp.dynamicValue=true and start with that @Value spring-boot app.
But after some time I need to change the value of testapp.dynamicValue without restarting the application.
I know that there are external solutions for this kind of issue but it would be great to make it straight from spring-boot application code without external libs.
Comment From: wilkinsona
Duplicates #259.
Comment From: hannah23280
Now we can't create the dynamic
application.propertiesorapplication.ymlkeys. For example, I want to declaretestapp.dynamicValue=trueand start with that@Valuespring-boot app. But after some time I need to change the value oftestapp.dynamicValuewithout restarting the application.I know that there are external solutions for this kind of issue but it would be great to make it straight from spring-boot application code without external libs.
I totally support this. On internet, everyone is talking about installing spring boot actuator, and then sending /refresh, and all that stuff, which practically assume properties are stored in another server (aka configuration server).
But what we need is dynamic reading of properties file without involving an external configuration server, and the environment object should be refreshed with the updated value of a specific property.