ITeye博客

关于spring cloud config使用/actuator/bus-refresh的405 not support 'POST'的错误

357029540 · 2018-10-22 16:41 · spring cloud · spring cloud config · 开源软件 · Markdown

今天在使用springboot 2.0的spring cloud config进行配置中心的验证git文件更新后,手动调用/actuator/bus-refresh端口时使用POST的方式出现以下错误

{
  "timestamp": "2018-10-22T08:31:08.684+0000",
  "status": 405,
  "error": "Method Not Allowed",
  "message": "Request method 'POST' not supported",
  "path": "/actuator/bus-refresh"
}

     配置文件在configServer端如下:

management.endpoints.web.exposure.include="*"

      这个问题就应该出现在这个配置上面,把"*"修改为*或者bus-refresh就不会出现这种问题了,这个问题找了很久才发现,也是让人郁闷。

    在客户端也需要注意,需要在配置文件中使用

management.endpoints.web.exposure.include=bus-refresh

 才能自动刷新缓存中的配置信息。

更多信息可以参考我的代码https://github.com/422518490/orderSystem.git

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。