问题
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:
- Routes configuration in application.yml file hosted in Spring Cloud Config Server (2.0.0.M7)
- Add/Delete/Modify routes in application.yml
- POST /actuator/refresh --> this will reload the routes definitions
- POST /application/gateway/refresh --> this will reload the routes
- Try new routes
来源:https://stackoverflow.com/questions/48287444/spring-cloud-gateway-refreshing-routes