歡迎光臨
每天分享高質量文章

關於Eureka 2.x,別再人云亦云了!

最近朋友圈被Eureka 2.x停止開發的新聞刷屏,例如:
  • Eureka 2.0 開源工作宣告停止,繼續使用風險自負[1]

  • 涼涼了,Eureka 宣佈閉源,Spring Cloud 何去何從?[2]

關於第二篇,我想說,這是在造謠。
不妨來看一下官方的言論:
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的版本維護相當勤快!
談談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實現了通用抽象,允許我們使用自己喜歡的服務發現元件!

  • 悲觀是好事,說明有危機感,但是過度解讀,消費開發人員的情懷就過分了。

相關連結:
  1. https://www.oschina.net/news/97521/eureka-2-0-discontinued

  2. https://www.oschina.net/news/97907/spring-cloud-vs-eureka

本文轉載自公眾號: A周立SpringCloud,點選檢視原文
Kubernetes入門與進階實戰培訓

本次培訓包括:Docker介紹、Docker映象、網路、儲存、容器安全;Kubernetes架構、設計理念、常用物件、網路、儲存、網路隔離、服務發現與負載均衡;Kubernetes核心元件、Pod、外掛、微服務、雲原生、Kubernetes Operator、叢集災備、Heml等,點選瞭解具體培訓內容

8月17日正式上課,點選閱讀原文連結即可報名。
贊(0)

分享創造快樂