Search code examples
spring-bootspring-cloudspring-boot-actuator

Difference between /env/reset and /refresh


For example I have a Config Server that just updated some property. Should I run /env/reset or /refresh on a client or both?

Functionalities seem to be overlapping according to Spring docs.

POST to /env to update the Environment and rebind @ConfigurationProperties and log levels

/refresh for re-loading the boot strap context and refreshing the @RefreshScope beans

What if I have @RefreshScope and @ConfigurationProperties is it a bad design?


Solution

  • Looking at the source code:

    • /env/reset will reset environment properties that were set through POST request to /env.

    • /refresh will pull new properties from the config server and rebind them with @RefreshScope beans.

    In Spring Boot 1.5.13