|
gateway 集成 nacos 实现动态路由,前几篇单独分析gateway网关时,仅介绍了静态路由的原理和使用,今天我们先分析动态路由,然后介绍一下两者的区别和优缺点。
一、动态路由实战分析:
1、构建一个springboot 服务,去掉web相关的jar:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
加上:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
引入相关核心jar
artifactId>common-gateway</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>common-gateway</name>
<description>网关服务</description>
<properties>
<java.
|