在1.5.x版本中通过management.security.enabled=false来暴露所有端点

在使用springcloud的时候,如果基于springboot2的版本的配置中心,无法使用SVN的刷新功能(修改配置后不需要重启服务器),那么需要重新按照新版本的要求进行配置

#yml格式
management:
 endpoints:
  web:
exposure: include: refresh
#properties文件格式
management.endpoints.web.exposure.include=*

同时在控制层需要加上相应注解

@RefreshScope // 使用该注解的类,会在接到SpringCloud配置中心配置刷新的时候,自动将新的配置更新到该类对应的字段中。
然后用post请求去访问http://localhost:8002/refresh

相关文章:

  • 2021-07-12
  • 2022-12-23
  • 2021-08-16
  • 2021-06-24
  • 2021-07-11
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-03-31
  • 2021-06-04
  • 2021-07-19
  • 2021-11-07
  • 2021-11-14
  • 2022-02-02
相关资源
相似解决方案