title: Reload property value when external property file changes ,spring boot
body: <p>I am using spring boot, and I have two external properties files, so that I can easily change its value.</p>
  
  <p>But I hope spring app will reload the changed value when it is updated, just like reading from files. Since property file is easy enough to meet my need, I hope I don' nessarily need a db or file. </p>
  
  <p>I use two different ways to load property value, code sample will like:</p>
  
  <pre><code>@RestController
  public class Prop1Controller{
  
      @Value("${prop1}")
      private String prop1;
  
  
      @RequestMapping(value="/prop1",method = RequestMethod.GET)
      public String getProp() {
          return prop1;
      }
  }
  
  
  @RestController
  public class Prop2Controller{
  
      @Autowired
      private Environment env;
  
      @RequestMapping(value="/prop2/{sysId}",method = RequestMethod.GET)
      public String prop2(@PathVariable String sysId) {
          return env.getProperty("prop2."+sysId);
      }
  }
  </code></pre>
  
  <p>I will boot my application with </p>
  
  <pre><code>-Dspring.config.location=conf/my.properties
  </code></pre>