Spring Cloud Gateway 是 Spring Cloud Finchley 版推出来的新组件,用来代替服务网关:Zuul。

那 Spring Cloud Gateway 和 Zuul 都有哪些区别呢,咱们来比较一下。

1、开源组织

Spring Cloud Gateway 是 Spring Cloud 微服务平台的一个子项目,属于 Spring 开源社区,依赖名叫:spring-cloud-starter-gateway。

https://spring.io/projects/spring-cloud-gateway

Zuul 是 Netflix 公司的开源项目,Spring Cloud 在 Netflix 项目中也已经集成了 Zuul,依赖名叫:spring-cloud-starter-netflix-zuul。

https://github.com/Netflix/zuul

2、底层实现

https://stackoverflow.com/questions/47092048/how-is-spring-cloud-gateway-different-from-zuul

据 Spring Cloud Gateway 原作者的解释:

Zuul构建于 Servlet 2.5,兼容 3.x,使用的是阻塞式的 API,不支持长连接,比如 websockets。另外

Spring Cloud Gateway构建于 Spring 5+,基于 Spring Boot 2.x 响应式的、非阻塞式的 API。同时,它支持 websockets,和 Spring 框架紧密集成,开发体验相对来说十分不错。

3、性能表现

这个没什么好比的,要比就和 Zuul 2.x 比,Zuul 2.x 在底层上有了很大的改变,使用了异步无阻塞式的 API,性能改善明显,不过现在 Spring Cloud 也没集成 Zuul 2.x,所以就没什么好比的。

如何选择?

本文说的 Zuul 指 Zuul 1.x,Netflix 早就发布了最新的 Zuul 2.x,但 Spring Cloud 貌似没有整合计划,栈长看了下目前最新的包,整合的还是 Zuul 1.x。

据了解,正是因为 Zuul 2.x 的不断跳票,Spring Cloud 才釜底抽薪推出了自己的服务网关:Spring Cloud Gateway,栈长看了下,使用起来比 Zuul 更简单,配置更方便,所以说选 Spring Cloud Gateway 没错,毕竟是 Spring Cloud 亲儿子,不会始乱终弃。

关注Java技术栈微信公众号,栈长将继续分享 Spring Cloud Gateway 的实战教程,公众号第一时间推送,持续关注。在公众号后台回复:cloud,获取栈长整理的更多的 Spring Cloud 教程,都是实战干货,以下仅为部分预览。

  • Spring Cloud 最新 Finchley 版本踩坑
  • Spring Cloud 多版本如何选择
  • Spring Cloud 是什么,和 Dubbo 对比
  • Spring Cloud 注册中心高可用搭建
  • Spring Cloud Eureka 自我保护机制
  • ……

本文原创首发于微信公众号:Java技术栈(id:javastack),关注公众号在后台回复 "cloud" 可获取更多 Spring Cloud 教程,转载请原样保留本信息。

Spring Cloud Gateway VS Zuul 比较,怎么选择?的更多相关文章

  1. 纠错帖:Zuul & Spring Cloud Gateway & Linkerd性能对比 (转载)

    纠错帖:Zuul & Spring Cloud Gateway & Linkerd性能对比  Spring Cloud  Spring Cloud Spring Cloud Gatew ...

  2. Spring cloud gateway

    ==================================为什么需要API gateway?==================================企业后台微服务互联互通, 因为 ...

  3. Spring Cloud Gateway(一):认识Spring Cloud Gateway

    1.Spring Cloud Gateway 简介 Spring Cloud Gateway 系列目录 Spring Cloud Gateway(一):认识Spring Cloud Gateway S ...

  4. spring Cloud网关之Spring Cloud Gateway

    Spring Cloud Gateway是什么?(官网地址:https://cloud.spring.io/spring-cloud-gateway/reference/html/) Spring C ...

  5. spring cloud gateway之filter篇

    转载请标明出处: https://www.fangzhipeng.com 本文出自方志朋的博客 在上一篇文章详细的介绍了Gateway的Predict,Predict决定了请求由哪一个路由处理,在路由 ...

  6. Spring Cloud Gateway真的有那么差吗?

    动机 已经不止一次看到"Spring Cloud Gateway性能比Zuul更差"的言论了,不少人人云亦云,来问我,既然如此,那Spring官方还开发Spring Cloud G ...

  7. 使用Spring Cloud Gateway保护反应式微服务(一)

    反应式编程是使你的应用程序更高效的一种越来越流行的方式.响应式应用程序异步调用响应,而不是调用资源并等待响应.这使他们可以释放处理能力,仅在必要时执行处理,并且比其他系统更有效地扩展. Java生态系 ...

  8. API网关性能比较:NGINX vs. ZUUL vs. Spring Cloud Gateway vs. Linkerd API 网关出现的原因

    API网关性能比较:NGINX vs. ZUUL vs. Spring Cloud Gateway vs. Linkerd http://www.infoq.com/cn/articles/compa ...

  9. 最全面的改造Zuul网关为Spring Cloud Gateway(包含Zuul核心实现和Spring Cloud Gateway核心实现)

    前言: 最近开发了Zuul网关的实现和Spring Cloud Gateway实现,对比Spring Cloud Gateway发现后者性能好支持场景也丰富.在高并发或者复杂的分布式下,后者限流和自定 ...

随机推荐

  1. Python: PS 滤镜--旋涡特效

    本文用Python 实现 PS 滤镜的旋涡特效,具体的算法原理和效果可以参考之前的博客: http://blog.csdn.net/matrix_space/article/details/42215 ...

  2. ZOJ3496 Assignment

    传送门 这题也是真恶心-- 题目大意是俩公司要运货,每条路有容量上限.然后B公司手里有p个--(技能点?)如果在一条路上放了x个技能点,这条路经过了y个货物,那么B公司就会收x*y的钱.现在要求的是, ...

  3. js数组,在遍历中删除元素(用 for (var i in arr)是无效的 )

    /** * 有效的方式 - 改变下标,控制遍历 */ for (var i = 0; i < arr.length; i++) { if (...) { arr.splice(i, 1); // ...

  4. web面试常见问题

    1事件继承 function ClassA(sColor) {     this.color = sColor;     this.sayColor = function () {        al ...

  5. nodejs 循环的陷阱

    Node.js 的异步机制由事件和回调函数实现,一开始接触可能会感觉违反常规,但习惯 以后就会发现还是很简单的.然而这之中其实暗藏了不少陷阱,一个很容易遇到的问题就是 循环中的回调函数,初学者经常容易 ...

  6. ThinkPHP3.2.3中,配置文件里配置项的读取

    在ThinkPHP3.2.3的版本中,配置项的读取,有两种情况. 是在PHP文件或者在PHP代码中的读取方法为C函数,例如:C('配置项的名称'); 在HTML模板中的读取方法为,例如{$Think. ...

  7. [Xcode 实际操作]九、实用进阶-(7)使用Xcode的版本管理功能(SCM)

    目录:[Swift]Xcode实际操作 本文将演示系统的版本控制功能. 软件配置管理(SCM):Software configuration management 是指通过执行版本控制.变更控制的规程 ...

  8. [Xcode 实际操作]九、实用进阶-(27)字符串文件(Localizable.strings)的本地化

    目录:[Swift]Xcode实际操作 本文将演示字符串文件(Localizable.strings)的本地化. 在项目[DemoApp]文件夹下点击鼠标右键,弹出右键菜单 ->[New Fil ...

  9. 记录下java的个人测试方法

    IDEA,用 JUnitGenerator V2.​ 0 做单元测试.. 如果是 SpringBoot,测试类上面加注解 @RunWith(SpringJUnit4ClassRunner.class) ...

  10. .netcore--Controller后台实现企业微信发送消息

    一.获得企业微信管理端权限,登录企业企业微信管理端界面,并创建应用,如下图中的[网站消息推送] 二.参见企业微信API文献,根据corpid=ID&corpsecret=SECRET(其中企业 ...