1

How I refresh the @PropertySouce(propertyFile) in spring.

for example :- There is a parameter in property file :-

   MY_APP_NAME=MY APPLICATION

and I am using

   @Autowired Enviornment env;

to get the property value from property file.

After that I want to change the property from "MY APPLICATION" to "APPLICATION".

    MY_APP_NAME=APPLICATION

It will need to restart the application but I don't want to restart the application.I want when I change the property it will reflect in application after some seconds.

Tejal
  • 764
  • 1
  • 10
  • 39
Vishal Monga
  • 272
  • 2
  • 14

1 Answers1

0

if your project is springboot you can use actuator , u can use 'http://localhost:port/refresh' to refresh your properties

ming
  • 1