Spring Boot Refresh w/o Config server

Viewed 47

Is there any way to refresh spring beans/properties w/o actuator and config server?

In my case, there is only one app/instance which reads the properties from the local file system

myapp.sample.prop1=1
myapp.sample.prop2=2

@ConfigurationProperties("myapp.sample")
public class Prop{

  private int prop1;
  private int prop2;

}

I autowire and i use it,

@Autowired
private Prop prop;

Occasionally the value might change in the file system. In that case,I just want to call my custom endpoint /reload which should refresh the values by reading the file.

0 Answers
Related