spring-cloud-netflix 组件概述
文章目录
- Spring-Cloud-Hoxton SR3
- 兼容矩阵
- 组件
- 实现方案
- 引发的问题
Spring-Cloud-Hoxton SR3
兼容矩阵
- https://spring.io/projects/spring-cloud
- Table 1. Release train Spring Boot compatibility:
Release Train | Boot Version |
---|---|
2021.0.x aka Jubilee | 2.6.x, 2.7.x (Starting with 2021.0.3) |
2020.0.x aka Ilford | 2.4.x, 2.5.x (Starting with 2020.0.3) |
Hoxton | 2.2.x, 2.3.x (Starting with SR5) |
Greenwich | 2.1.x |
Finchley | 2.0.x |
Edgware | 1.5.x |
Dalston | 1.5.x |
组件
- 为了让微服务这一套应用运行起来, 需要各种组件的支持, 按其关键性 必要与非必要 我把它分为几类组件: 基础/核心组件, 性能组件, 辅助解决/排查问题组件, 其他组件
- 基础/核心组件
- eureka(netflix), : 注册中心一定得有, 没有它无法实现服务得发现 更无法实现服务调用
- feign(netflix), : 没有feign 远程调用会很麻烦
- zuul(netflix)/gateway,
- 性能组件:
-
ribbon(netflix)/cloud_loadbalancer, : 每个应用多个实例, 必须得负载均衡调用
-
hytrix(netflix)
-
web_flux, sentinal
-
- 辅助组件:
-
spring-cloud-admin
-
spring_cloud_config,
-
spring-sleuth, zipkin, sky-walking
-
actuator:服务节点信息上报
-
实现方案
- 带
*
号不建议使用;
组件 | netflix | 官方 | Alibaba | zookeeper | consul | kubernetes |
---|---|---|---|---|---|---|
分布式配置 | Archaius* | spring-cloud-config;spring-environment;SCC client/server | Nacos | zookeeper | consul | configMap |
服务注册/发现 | Eureka-1.0;Eureka-2.0* | Service-Registry,Service-Discovery | Nacos | zookeeper | consul | Api Server |
服务熔断 | Hystrix* | Spring-Cloud-Circuit-Breaker | Sentinel | - | - | - |
服务调用 | Feign | OpenFeign/RestTemplate | Dubbo Rpc | - | - | - |
服务路由 | Zuul | spring-cloud-geteway | Dubbo Proxy | - | - | - |
负载均衡 | Ribbon* | Srping-Cloud-LoadBanlancer | Dubbo LB | - | - | - |
分布式事务 | - | - | Seata | - | - | - |
分布式消息 | - | SCS RabbitMQ/Kafka;Spring-Cloud-Stream | SCS RocketMQ | - | SCS consul | - |
消息总线 | - | Spring-Cloud-Bus | SCB | - | SCB consul | - |
引发的问题
-
事务 -> 分布式事务
-
线程同步/锁 -> 分布式锁: zookeeper-包装成curator, redis-Redlock
-
分布式任务调度
-
分布式文件存储
-
企业级消息总线: 统一消息格式, 消息聚合 过滤 路由
- SpringCloudStream;
- SpringIntegration; Apache-Camel;
- Spring-Messaging
-
MQ 直连: spring-for/activeMQ/RabbitMQ/Kafka/RocketMQ