Spring Cloud 组件与服务发现详解
1. Spring Cloud 组件介绍
1.1 Spring Cloud Gateway 与 Netflix Zuul v1 的区别
Spring Cloud Gateway 基于非阻塞 API,使用 Spring 6、Project Reactor 和 Spring Boot 3,而 Netflix Zuul v1 基于阻塞 API。这意味着 Spring Cloud Gateway 能够处理比 Netflix Zuul v1 更多的并发请求,对于所有外部流量都要经过的边缘服务器来说非常重要。
外部客户端的所有请求都会通过 Spring Cloud Gateway 这个边缘服务器,它会根据 URL 路径将请求路由到目标微服务。例如,以 /product-composite/ 开头的外部请求会被发送到 Product Composite 微服务,而核心服务 Product、Recommendation 和 Review 无法直接从外部客户端访问。
1.2 Spring Cloud Config 用于集中配置
Spring Cloud 中的 Spring Cloud Config 可根据相关要求对微服务系统的配置文件进行集中管理。它支持将配置文件存储在多种不同的后端,包括:
- Git 仓库(如 GitHub 或 Bitbucket)
- 本地文件系统
- HashiCorp Vault
- JDBC 数据库
Spring Cloud Config 允许以分层结构处理配置,可将通用配置部分放在公共文
超级会员免费看
订阅专栏 解锁全文
168万+

被折叠的 条评论
为什么被折叠?



