Spring Cloud Alibaba Dubbo (待续)

Spring Cloud Alibaba Dubbo 是基于Dubbo Spring Boot 2.7.3和Spring Cloud 2.x构建的,旨在降低云原生开发成本,提升研发效率和应用性能。它作为Spring Cloud的增强版,不仅全面覆盖Spring Cloud的特性,还提供了更稳定成熟的实现,如服务注册、发现和调用。此外,文中提到了Sentinel作为流量控制、熔断和系统保护的工具,以及Spring Cloud Sleuth和Zipkin用于跟踪和监控。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://spring-cloud-alibaba-group.github.io/github-pages/greenwich/spring-cloud-alibaba.html#_spring_cloud_alibaba_dubbo

6.1 Introduction
Dubbo Spring Cloud is based on Dubbo Spring Boot 2.7.3[1] and Spring Cloud 2.x development, whether the developer is a Dubbo user or a Spring Cloud user. Easily navigate and move apps up at a cost close to “zero” costs. Dubbo Spring Cloud is designed to simplify Cloud Native development costs, improve R&D performance, and improve application performance.

6.2 Features
Since Dubbo Spring Cloud is built on top of the native Spring Cloud, its service governance capabilities are considered Spring Cloud Plus. Not only does it fully cover the Spring Cloud native features [5], but it also provides a more stable and mature implementation, as shown in the following table:

dubbo现在集成到了springcloudAlibaba了,可以配置 ; 服务注册,发现,调用

6.3 Reference
[1]: Starting with 2.7.0, Dubbo Spring Boot and Dubbo are consistent in version

[2]: Preview releases of Spring Cloud Alibaba are available: 0.9.0, 0.2.2, and 0.1.2 - https://spring.io/blog/2011/04/11/preview-releases-of-spring-cloud-alibaba-are-available-0-9-0-0-2-2-and-0-1-2

[3]: The current version of the Spring Cloud “F” is: Finchley.SR2 - https://cloud.spring.io/spring-cloud-static/Finchley.SR2/single/spring-cloud.html

[4]: The current Spring Cloud “G” version is Greenwich.RELEASE

[5]: Spring Cloud feature list - https://cloud.spring.io/spring-cloud-static/Greenwich.RELEASE/single/spring-cloud.html#_features

[6]: Dubbo 2.7 starts supporting the configuration center and can be customized - http://dubbo.apache.org/en-us/docs/user/configuration/config-center.html

[7]: Spring Cloud native registry, in addition to Eureka, Zookeeper, and Consul, includes Nacos in Spring Cloud Alibaba

[8]: Dubbo Native Registration Center - http://dubbo.apache.org/en-us/docs/user/references/registry/introduction.html

[9]: Alibaba Sentinel: Sentinel uses traffic as an entry point to protect service stability from multiple dimensions such as flow control, blowdown, and system load protection - https://github.com/alibaba/Sentinel/wiki/%E4%BB%8B %E7%BB%8D, currently Sentinel has been accepted as a candidate for Circuit Breaker by the Spring Cloud project - https://spring.io/blog/2011/04/8/introducing-spring-cloud-circuit-breaker

[10]:Spring Cloud Sleuth - https://spring.io/projects/spring-cloud-sleuth

[11]: Zipkin - https://github.com/apache/incubator-zipkin

### Spring Cloud AlibabaDubbo 的主要差异 #### 微服务体系定位 Spring Cloud Alibaba 是一套基于 Spring Cloud 实现的微服务解决方案,旨在简化分布式系统的开发过程[^2]。而 Dubbo 则是一个高性能的 Java RPC 框架,在阿里巴巴内部得到广泛应用并开源出来,专注于服务治理方面。 #### 协议支持 Spring Cloud Alibaba 支持多种协议来实现远程过程调用 (RPC),包括 HTTP/REST、gRPC 等标准互联网通信方式;相比之下,Dubbo 主要采用自定义二进制协议进行高效的服务间交互,并且默认情况下不直接兼容HTTP接口[^1]。 #### 配置管理 对于配置中心的支持上,两者都推荐使用 Nacos 或 Apollo 进行统一管理和动态刷新配置项。不过在具体实践过程中,由于 Spring Cloud Alibaba 更紧密地集成了 Spring Boot/Spring Cloud 生态圈内的工具链,因此其配置更加灵活便捷[^4]。 #### 服务发现机制 当涉及到服务注册与发现时,二者都可以借助于像 Eureka、Consul 或者 Nacos 来完成这一任务。然而值得注意的是,Dubbo 对 Zookeeper 存有较强依赖性作为早期版本中的唯一选型之一,尽管现在也已经扩展到了其他选项之上[^3]。 #### 编程模型 编程体验上的不同之处在于,开发者利用 Spring Cloud Alibaba 构建应用程序通常会遵循 Spring MVC 注解风格编写控制器层逻辑,而对于 Dubbo 用户来说,则更多地围绕着 `@Service` 及 `@Reference` 注解来进行声明式方法注入和服务消费操作。 ```java // 使用 @Reference 注解的方式获取远端服务实例 @RestController @RequestMapping("/consumer") @Slf4j public class ConsumerController { @Reference(check = false, version = "1.0.0") private IdGenerateApi idGenerateApi; @GetMapping("/getId") public Object test() { return idGenerateApi.getId(""); } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值