0

In a spring boot application, I am able to bind properties from application.yml to the bean fields using @ConfigurationProperties annotation.

Is it possible to update these properties in application.yml at runtime and get them reflected in the bean? If yes. How to do this?

Raju Khunt
  • 149
  • 2
  • 2
  • 11
  • 1
    Does this answer your question? [How change property values at runtime in Spring](https://stackoverflow.com/questions/38761781/how-change-property-values-at-runtime-in-spring) – Ankit Chauhan Jul 23 '20 at 05:07
  • If you want the application to reload while it is running, you will need to decide how will it know, it has to reload. Will it check if file has changed say every 5 minutes? will you call an endpoint like `refresh` to tell it to reload? have a look at https://www.baeldung.com/spring-reloading-properties – Kavithakaran Kanapathippillai Jul 23 '20 at 06:38

0 Answers0