spring-cloud / spring-cloud-gateway

An API Gateway built on Spring Framework and Spring Boot providing routing and more.
http://cloud.spring.io
Apache License 2.0
4.55k stars 3.33k forks source link

r2dbc RouteDefinitionLocator implementation #1667

Open sumitbadwal opened 4 years ago

sumitbadwal commented 4 years ago

Is your feature request related to a problem? Please describe. For every new API in microservices. I've to update the route in method public RouteLocator gatewayRoutes(RouteLocatorBuilder builder) of Spring Cloud Gateway and deploy the same.
I read "Future milestone versions will have RouteDefinitionLocator implementations based off of Spring Data Repositories, such as Redis, MongoDB, and Cassandra." on https://cloud.spring.io/spring-cloud-gateway/reference/html/ hence wanted to know if this can expected soon.

Describe the solution you'd like A Redis or Mysql Route Configuration with a mechanism to auto refresh or periodic refresh in built.

Describe alternatives you've considered An alternative I've thought is to rebuild routes in Spring Cloud Gateway itself by fetching routes from external source (db, service) manually. The routes would be built by overriding getRouteDefinitions and implementing RouteDefinitionLocator .This can be initiated from "/actuator/gateway/refresh". Not sure if this will work.

spencergibb commented 4 years ago

See #1316 for redis. Let's repurpose this for r2dbc.