Spring Cloud是一個微服務框架,相比Dubbo等RPC框架, Spring Cloud提供的全套的分布式系統解決方案。 配置管理,服務治理,熔斷機制,智能路由,微代理,控制總線,一次性token,全局一致性鎖,leader選舉,分布式session,集群狀態管理等。
SpringCloud非常適合中小企業快速構建分布式系統,可以節省大量的人力,物力成本。
----------------------------------------------------------------------------------------------------------------------------
SpringCloud-Example是我在本機搭建的一套系統,僅供入門學習使用。
運行環境:
jdk:1.8
SpringBoot:2.0.6.RELEASE
SpringCloud:Finchley.RELEASE
模塊介紹:
- common:公共包
- config-client:配置中心的Client測試模塊
- config-server:配置中心Server
- consumer-service:消費者模塊,包含hystrix功能
- eureka-server:Eureka Server,服務注冊中心。相當於zookeeper
- gateway-zuul:反向代理&負載均衡模塊,相當於Nginx
- monitor-turbine:監控模塊,hystrix只能實現單個微服務的監控,而turbine可以實現集群監控
- order-service-api:公共api定義模塊,消費者和提供者都依賴該模塊,共用pojo,接口定義等
- provider-order-service:訂單服務
- provider-user-serviceA:用戶服務A
- provider-user-serviceB:用戶服務B
- trace-zipkin:鏈路監控模塊
源碼地址:https://github.com/shileishmily/SpringCloud-Example.git