Fork me on GitHub

关于Eureka 2.x,别再人云亦云了!

目录

最近朋友圈被Eureka 2.x停止开发的新闻刷屏,例如:

关于第二篇,我想说,这是在造谣。

不妨来看一下官方的言论:

The open source work on eureka 2.0 has been discontinued. The code base and artifacts that were released as part of the existing repository of work on the 2.x branch is considered use at your own risk.

来自:https://github.com/Netflix/eureka/wiki

看清楚官方的言辞:官方只是说Eureka 2.0的开发被停止了,如果您将Eureka 2.0分支用在生产,将后果自负!

看起来挺吓人的。但真的那么可怕吗?

关于Eureka版本

Eureka 2.x从来就没有正式发布过! 目前最新的稳定版本是1.9.3。笔者第一次看到Eureka 2.0的文章是2016年,那时候官方宣称要开发Eureka 2.0,使用小批量的消息推送替代Eureka 1.x中的纯心跳机制(基于定时任务)的消息传递。

但是两年过去了,Eureka 2.0最终没有孵化出来,但是绝不代表Eureka的闭源!官方依然在积极地维护Eureka 1.x!

不妨来看一下Eureka的发布历史:https://github.com/Netflix/eureka/releases

eureka发布日志

可以看到,Eureka的版本维护相当勤快!

谈谈2.x的流产

就笔者的研究来看,官方关闭2.x分支至少2年了。只是最近可能考虑到会有团队会将Eureka 2.x用于线上,甚至基于2.x开发,所以友情提示一下。

但是问题是:大部分用户都是因为Spring Cloud才接触到Eureka,Spring Cloud使用的是Eureka 1.x!退一万步,你会在自己项目中使用一个非正式发布的版本吗?

在我来看,这就是个友情提示,连个新闻都算不上。宣布停止开发已经停止2年的分支,还能算是新闻吗?

不是个例

事实上,这不是Netflix(开源Eureka的公司)第一次跳票了。

2016年,Netflix宣布将在16年底或17年初开源Zuul 2.x,结果写完发现太复杂了,而且性能提升也没有达到预期。于是官方选择完全重构!知道2018年1月,Zuul 2.x才被开源,2018年4月才发布到中央仓库!

https://github.com/netflix/zuul/tree/1.x

A lot of people are asking about the status of Zuul 2.0. We are actively working on open sourcing it and with it, likely many filters that we use at Netflix. Yes, we realize it’s been a long time coming. When we initially wrote Zuul 2.0, we heavily relied on RxJava to string filters together with Netty. This ended up adding a lot of complexity to the Zuul 2.0 core as well as made it quite difficult to operate and debug. We didn’t think it was right to release Zuul 2.0 like this. So we spent a lot of time refactoring out this pattern, using Netty constructs directly. This took the better part of a year to complete and deploy safely within Netflix. So this work is now done. We are working towards releasing this much better, easier to understand, and more reliable Zuul 2.0. Obviously Netflix’s business priorities take precedence to our open sourcing efforts, so as we get free time we will put efforts to open sourcing! Stay Tuned.

Current Zuul 2 development is on the 2.1 branch

其他项目的类似情况

不妨多聊聊。相信大家都很熟悉Netty,或者至少听说过。

Netty也有类似的情况。Netty团队开源Netty 5后,发现代码复杂度过高,同时性能提升也并没有预期中的那么好,于是停止了Netty 5的开发。

那是不是说Netty 5闭源了?

退一万步

退一万步讲,Eureka即使闭源,Spring Cloud也不至于凉凉。Spring Cloud支持使用Eureka、Zookeeper、Consul实现服务发现的能力。

从Eureka切换成Zookeeper只需要改个依赖,加两行配置就可以了。

总结

总而言之:

  • Eureka没有闭源,是Eurkea 2.x分支不再维护!
  • Spring Cloud并不强依赖Eureka,Spring Cloud Commons实现了通用抽象,允许我们使用自己喜欢的服务发现组件!
  • 悲观是好事,说明有危机感,但是过度解读,消费开发人员的情怀就过分了。

相关文章

评论系统未开启,无法评论!