Spring Cloud 微服务开发:入门、进阶与源码剖析 —— 9.7 Spring Cloud Gateway 动态路由

9.7 Spring Cloud Gateway 动态路由

本章前几节我们介绍了Spring Cloud Gateway的路由配置,但都是将路由的配置和规则加载到内存里,需要重启才能生效,在实际生产过程中,为了保证程序的高可用以及尽量避免重启,所以我们需要实现路由的动态配置。

本案编码主要用来讲解如何实现Spring Cloud Gateway的动态路由配置。

1.spring-cloud-gateway-dynamic-routing

(1)引入依赖

父项目依赖

代码清单:ch9_7/ch9_7_gateway_dynamic_routing/pom.xml


<dependency>
    <groupId>org.springframework.boot</groupId>
    

猜你喜欢

转载自blog.csdn.net/meteor_93/article/details/104571173
今日推荐