Reputation: 473
In my spring boot application I have external property file. I am loading that property file at the initialization level.
@Component
@ConfigurationProperties(locations = "classpath:test.properties")
public class URITemplate
{
private String urlOne;
private String urlTwo;
}
Now At run time I want to update this property file and reload it in spring boot application..
Thanks in advance.
Upvotes: 0
Views: 889
Reputation: 623
I think you better configure properties for compilation (before running) and not change them on runtime. Generally, the idea behind properties is to have them static.
Following this article, the best approach is to think what you use the properties for and then consider changing those into variables - which are mutable at runtime.
Good luck!
Upvotes: 1