简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM