一、Spring Cloud Gateway
1.1 概述
所谓的网关就是指系统的统一入口,它封装了运用程序的内部结构,为客户端提供统一的服务,一些与业务功能无关的公共逻辑可以在这里实现,诸如认证、鉴权、监控、路由转发等。
Spring Cloud Gateway
是Spring Cloud
推出的第二代网关,是由WebFlux
、Netty
、Reactor
实现的响应式的API
网关,需要 Spring Boot
和 Spring Webflux
提供的 Netty
环境运行,不能在传统的Servlet
容器中工作,也不能构建成War
包。
Spring Cloud Gateway
旨在为微服务提供一种简单且有效的API
路由的管理方式,并基于Filter
的方式提供网关的基本功能。
1.2 核心概念
- 路由(
Route
):