1. 引言
Spring Cloud Gateway通常用作一个或多个服务的门面,从而为客户提供了一种更简单的消费服务的方式。
在本教程中,我们将展示通过在将请求发送到后端之前重写URL来定制公开API的不同方式。
2. Spring Cloud Gateway快速回顾
Spring Cloud Gateway项目是建立在流行的Spring Boot 2和Project Reactor之上的,因此它继承了其主要特点:
- 由于其响应式特性,资源使用率低
- 支持Spring Cloud生态系统中的所有好处(发现、配置等)
- 使用标准Spring模式易于扩展和/或自定义
大约 6 分钟