距離Spring Boot 2.2.0的發佈已經有一個半月左右時間,因爲與之匹配的Spring Cloud版本一直沒有Release,因此在這期間碰到很多讀者諮詢的問題都是因爲Spring Boot和Spring Cloud版本不匹配致使。spring
不少時候,咱們在學習或重建系統的時候都喜歡直接選用最高版原本開發,可是在使用Spring全家桶的時候,這樣的選擇不必定是最佳選擇。主要仍是因爲Spring全家桶中各項目之間還存在必定的依賴關係。尤爲是在大版本迭代期間,是咱們尤爲要注意的。好比,此次Spring Framework、Spring Boot、Spring Cloud的升級,是一次總體的大版本的升級,涵蓋了Spring Framework 5.二、Spring Boot 2.二、Spring Cloud Hoxton。負載均衡
因爲Spring Boot 2.2基於Spring Framework 5.2構建,而Spring Cloud Hoxton又基於Spring Boot 2.2構建。因此,在Spring Cloud Hoxton發佈Release版本以前,出現了不少Spring Boot 2.2搭配Spring Cloud Greenwich版本使用而出現各類莫名問題的狀況。spring-boot
如今Spring Cloud Hoxton的正式發佈,也預示着Spring Cloud用戶能夠正式開始往Spring Boot 2.2.x版本進行逐步升級。性能
Spring Cloud Hoxton版本內容
下面咱們來關注下在Spring Cloud Hoxton版本中都提高了哪些內容。先來看看此次各依賴項目的版本升級:學習
- Spring Cloud Aws 2.2.0.RELEASE
- Spring Cloud Vault 2.2.0.RELEASE
- Spring Cloud Circuitbreaker 1.0.0.RELEASE
- Spring Cloud Cli 2.2.0.RELEASE
- Spring Cloud Gateway 2.2.0.RELEASE
- Spring Cloud Zookeeper 2.2.0.RELEASE
- Spring Cloud Starter Hoxton.RELEASE
- Spring Cloud Build 2.2.0.RELEASE
- Spring Cloud Config 2.2.0.RELEASE
- Spring Cloud Dependencies Parent 2.2.0.RELEASE
- Spring Cloud Starter Parent Hoxton.RELEASE
- Spring Cloud Sleuth 2.2.0.RELEASE
- Spring Cloud Contract 2.2.0.RELEASE
- Spring Cloud Gcp 1.2.0.RELEASE
- Spring Cloud Bus 2.2.0.RELEASE
- Spring Cloud Consul 2.2.0.RELEASE
- Spring Cloud Stream Horsham.RELEASE
- Spring Cloud Kubernetes 1.1.0.RELEASE
- Spring Cloud Openfeign 2.2.0.RELEASE
- Spring Cloud Commons 2.2.0.RELEASE
- Spring Cloud Dependencies Hoxton.RELEASE
- Spring Cloud Task 2.2.0.RC1
- Spring Cloud Function 3.0.0.RELEASE
- Spring Cloud Hoxton.RELEASE
- Spring Cloud Netflix 2.2.0.RELEASE
- Spring Cloud Security 2.2.0.RELEASE
- Spring Cloud Release Hoxton.RELEASE
- Spring Cloud Cloudfoundry 2.2.0.RELEASE
在此次的版本升級中,我以爲如下幾點是很是值得讀者關注和學習的:ui
新的負載均衡器實現spa
Spring Cloud Hoxton版本中第一次引入同時支持阻塞式與非阻塞式的負載均衡器來做爲已經進入維護狀態的Netflix Ribbon。code
經過引入org.springframework.cloud:spring-cloud-loadbalancer
依賴,你就能夠將新的BlockingLoadBalancerClient
與RestTemplate
一塊兒使用了。blog
同時,該依賴的引入也將支持Reactive應用,跟其餘使用同樣,只須要使用@LoadBalanced
來修飾WebClient.Builder
便可。教程
新的斷路器實現
該項目中定義了斷路器的抽象API,以及對各開源實現的整合封裝,其中包括:
- Resilience4j
- Spring Retry
- Hystrix (spring-cloud-netflix)
- Sentinel (spring-cloud-alibaba)
加入更多Reactive支持
- Spring Cloud Gateway中增長ReactiveLoadBalancer
- 如下組件中增長ReactiveDiscoveryClient服務發現實現:
- Spring Cloud Netflix
- Spring Cloud Consul
- Spring Cloud Zookeeper
- Spring Cloud Openfeign
- Spring Cloud Cloudfoundry
- Spring Cloud Kubernetes
相關閱讀
歡迎關注個人公衆號:程序猿DD,得到獨家整理的學習資源和平常乾貨推送。 若是您對個人專題內容感興趣,也能夠關注個人博客:didispace.com