我们 dubbogo 社区很高兴地宣布发布最新版本 v3.3.0!这一版本带来了多个 Bug 修复、新特性以及代码优化,显著提升了 dubbogo 的稳定性与功能性。
## 🚀 版本亮点
在本次更新中,我们对多个核心组件进行了改进,以解决服务发现、注册中心相关的问题,并优化内存管理,减少内存泄漏。此外,我们增强了底层通信库的错误处理能力,并提升了系统的整体稳定性,为 Go 开发者提供更强大、更可靠的微服务开发体验。
本次更新的主要改进包括:修复了多个服务发现和注册中心相关的问题,解决了内存泄漏,并增强了底层通信库的错误处理能力和稳定性。此外,还新增了脚本路由功能、增强了 Java 兼容性、支持 Triple 协议 Keepalive 以及引入基于 Protobuf 的 MetadataService。
---
## 更新亮点
---
### ✨ 主要新特性
- **脚本化路由功能**:支持基于脚本的动态路由配置,提高服务治理的灵活性。
- **增强 Java 互操作性**:进一步优化 Dubbo-Go 与 Java 生态的兼容性。
- **Triple 协议 Keepalive**:为 Triple 协议引入 Keepalive 配置,增强长连接的稳定性。
- **Protobuf 元数据服务支持**:支持基于 Protobuf 的 `MetadataService`,更好地支持微服务治理。
- **Nacos 注册中心增强**:支持多类别订阅,提升 Nacos 作为注册中心的适用性。
### 🛠 稳定性提升
- **修复 OTEL-GRPC 导出器初始化问题**,确保 OpenTelemetry 监控功能正常运行。
- **解决 Nacos/Zookeeper 服务发现和订阅相关问题**,提升注册中心的稳定性。
- **修复内存泄漏问题**,优化 `BaseInvoker` 和 `slice` 截取的内存管理。
- **改进 Triple 协议的错误处理**,增强通信稳定性,避免未实现方法导致的错误。
### 📈 代码优化增强
- **重构超时单位**:Dubbo 协议超时时间单位统一调整为毫秒。
- **更新条件规则排序逻辑**,确保路由规则执行顺序的稳定性。
- **业务错误与 RPC 传输错误分离**,便于更精准地识别错误来源。
---
## 详细更新内容
---
### 🐞 Bug 修复
- 修复 OTEL-GRPC 导出器的初始化问题。 [#2666](https://github.com/apache/dubbo-go/pull/2666) [#2679](https://github.com/apache/dubbo-go/pull/2679)
- 解决测试用例不一致的问题。 [#2660](https://github.com/apache/dubbo-go/pull/2660)
- 修复 makezero bug。 [#2682](https://github.com/apache/dubbo-go/pull/2682)
- 解决 nacos 服务发现问题。 [#2691](https://github.com/apache/dubbo-go/pull/2691) [#2694](https://github.com/apache/dubbo-go/pull/2694)
- 修正 protoc-gen-go-triple 路径错误。 [#2690](https://github.com/apache/dubbo-go/pull/2690)
- 修复因 nil backupCodec 导致的分段错误。 [#2698](https://github.com/apache/dubbo-go/pull/2698)
- 解决 zookeeper 映射键问题。 [#2711](https://github.com/apache/dubbo-go/pull/2711)
- 解决 nacos 注册中心 `*` 订阅问题。 [#2713](https://github.com/apache/dubbo-go/pull/2713)
- 解决 nacos 服务发现无法获取所有服务名称的问题。 [#2715](https://github.com/apache/dubbo-go/pull/2715)
- 解决潜在的死锁问题。[#2716](https://github.com/apache/dubbo-go/pull/2716)
- 修复服务断连和配置失效的问题。 [#2717](https://github.com/apache/dubbo-go/pull/2717)
- 处理 triple handler 错误,采用 codeUnimplemented 机制。 [#2719](https://github.com/apache/dubbo-go/pull/2719)
- 修复路由规则解析日志错误。 [#2720](https://github.com/apache/dubbo-go/pull/2720)
- 通过设置 baseinvoker 的 URL 为 nil 解决内存泄漏问题。 [#2726](https://github.com/apache/dubbo-go/pull/2726)
- 修复 CallClientStream 结果处理错误。 [#2732](https://github.com/apache/dubbo-go/pull/2732)
- 修正切片初始化长度问题。 [#2734](https://github.com/apache/dubbo-go/pull/2734)
- 增强日志记录,添加文件名、函数名和行号。[#2744](https://github.com/apache/dubbo-go/pull/2744)
- 解决 HTTP 代理请求自动驼峰转换问题。 [#2746](https://github.com/apache/dubbo-go/pull/2746)
- 修复 golangci-lint 报告的问题。 [#2754](https://github.com/apache/dubbo-go/pull/2754)
- 修正 dubbo_registry_directory 指标类型错误。[#2766](https://github.com/apache/dubbo-go/pull/2766)
- 修复 findMappedServices 可能引发的 panic。[#2768](https://github.com/apache/dubbo-go/pull/2768)
- 确保 CacheListener 中的 ListenerSet 线程安全。 [#2769](https://github.com/apache/dubbo-go/pull/2769)
- 改进订阅行为,等待注册完成或超时。[#2775](https://github.com/apache/dubbo-go/pull/2775)
- 解决 rc.id 始终为空的问题。 [#2778](https://github.com/apache/dubbo-go/pull/2778)
- 修复相同地址无法区分不同注册中心的问题。 [#2784](https://github.com/apache/dubbo-go/pull/2784)
- 移除不必要的 setdeadline 调用。 [#2785](https://github.com/apache/dubbo-go/pull/2785)
- 修复多个错误返回问题。 [#2791](https://github.com/apache/dubbo-go/pull/2791)
- 解决额外的内存泄漏问题。 [#2792](https://github.com/apache/dubbo-go/pull/2792)
- 修正部分不准确的注释。 [#2793](https://github.com/apache/dubbo-go/pull/2793)
- 修复 ReadMessage() 竞态问题。 [getty#123](https://github.com/apache/dubbo-getty/pull/123)
- 修复因切片截取导致的内存泄漏问题。 [#hessian2/374](https://github.com/apache/dubbo-go-hessian2/pull/374)
- 解决了 dubbogo-cli 中 ZooKeeper 的 URL 解析 panic 并改进了错误处理。 [2795](https://github.com/apache/dubbo-go/pull/2795)
### 🚀 新特性
- 添加了基于脚本的路由功能。 [#2669](https://github.com/apache/dubbo-go/pull/2669)
- 引入了对多目的地条件路由的支持。 [#2685](https://github.com/apache/dubbo-go/pull/2685)
- 实现了新的条件规则。 [#2686](https://github.com/apache/dubbo-go/pull/2686)
- 增强了 Java 互操作性。 [#2687](https://github.com/apache/dubbo-go/pull/2687)
- 添加了基于 Protobuf 的 MetadataService 支持。 [#2723](https://github.com/apache/dubbo-go/pull/2723)
- 引入了 triple 协议的 keepalive 配置。 [#2757](https://github.com/apache/dubbo-go/pull/2757)
- 增强了 nacos 注册中心的多类别订阅支持。 [#2783](https://github.com/apache/dubbo-go/pull/2783)
- 添加了 triple 协议 keepalive 配置。 [#triple87](https://github.com/dubbogo/triple/pull/87)
- 添加了 triple 协议连接池。 [#triple91](https://github.com/dubbogo/triple/pull/91)
### 📌 代码优化
- 为元数据添加了单元测试。 [#2665](https://github.com/apache/dubbo-go/pull/2665)
- 改进了代码注释。 [#2668](https://github.com/apache/dubbo-go/pull/2668)
- 将方法 `WithClientCheck` 重命名为 `WithClientNoCheck`。 [#2680](https://github.com/apache/dubbo-go/pull/2680)
- 优化了 Nacos 端点处理。 [#2692](https://github.com/apache/dubbo-go/pull/2692)
- 更新了 `UseAsMetaReport` 和 `UseAsConfigCenter` 以使用字符串值来防止覆盖。 [#2693](https://github.com/apache/dubbo-go/pull/2693)
- 更新了条件规则排序逻辑。 [#2688](https://github.com/apache/dubbo-go/pull/2688)
- 区分了业务错误和 RPC 网络错误。 [#2712](https://github.com/apache/dubbo-go/pull/2712)
- 标准化了 Dubbo 协议中的超时单位(毫秒)。 [#2737](https://github.com/apache/dubbo-go/pull/2737)
- 将内部组件移动到 dubbo-go-samples 仓库。 [2794](https://github.com/apache/dubbo-go/pull/2794)
- 限制了重新连接的尝试次数和持续时间。 [getty#117](https://github.com/apache/dubbo-getty/pull/123)
## ❤️ 特别感谢
感谢所有为本次发布做出贡献的社区成员!!您的贡献使得 Dubbo-Go 变得更加高效和强大:
```
@1kasa
@AlbumenJ
@AlexStocks
@alingse
@ALLen442
@baerwang
@chickenlj
@cuishuang
@FinalT
@FoghostCn
@gexincoding
@knowmost
@linfeip
@marsevilspirit
@Nexusrex18
@No-SilverBullet
@SHA-4096
@ShawnJeffersonWang
@snowLeopard331
@solisamicus
@wcy666103
@YarBor
@yumosx
```
## 📥 升级
强烈建议所有 dubbogo 用户升级到最新版本,以享受更稳定、高效的服务体验。
**链接:**
- GitHub 仓库:https://github.com/apache/dubbo-go
- 📌 访问 GitHub 获取最新版本:[Apache Dubbo-Go Releases v3.3.0](https://github.com/apache/dubbo-go/releases/tag/v3.3.0)
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




