Spring Cloud Gateway - Refreshing routes

坚强是说给别人听的谎言 提交于 2019-12-08 06:09:07

问题


Using spring-cloud-gateway 2.0.0.M5, Im defining routes in configuration file (application.yml). I'm trying to update these routes by calling POST /application/gateway/refresh.

Modified routes, or new routes, are not refreshed, even though I see (with a breakpoint) that a refresh routine is actually executed.

Is the refresh supposed to work when routes are defined in configuration files ? Something I am missing ?

The use case would be routes defined in spring config server.


回答1:


For those struggling with the same issue, here is a setup which works with 2.0.0.M5:

  1. Routes configuration in application.yml file hosted in Spring Cloud Config Server (2.0.0.M7)
  2. Add/Delete/Modify routes in application.yml
  3. POST /actuator/refresh --> this will reload the routes definitions
  4. POST /application/gateway/refresh --> this will reload the routes
  5. Try new routes


来源:https://stackoverflow.com/questions/48287444/spring-cloud-gateway-refreshing-routes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!