Skip to content

feat(rocketmq): 新增 RocketMQ Agent、适配器与管理控制台#3887

Merged
t8y2 merged 19 commits into
t8y2:mainfrom
aiLi0617:aili
Jul 20, 2026
Merged

feat(rocketmq): 新增 RocketMQ Agent、适配器与管理控制台#3887
t8y2 merged 19 commits into
t8y2:mainfrom
aiLi0617:aili

Conversation

@aiLi0617

Copy link
Copy Markdown
Contributor

变更说明

为 DBX 新增 Apache RocketMQ 消息队列管理能力,覆盖 Agent、Rust 适配层、前后端 API 与 MQ 管理控制台 UI。
主要改动:
Java Agent:新增 agents/drivers/rocketmq/,基于 rocketmq-client / rocketmq-tools 5.3.1 实现 Topic、消费组、消息查询/追踪、ACL、Broker 等管理接口
Rust 适配层:新增 RocketMqAdmin,扩展 MQ 类型与 capabilities(message query / DLQ / trace),统一 Agent 启动解析(resolve_mq_agent_launch_spec)
前端:连接对话框增加 RocketMQ 独立入口(NameServer 地址、ACL 认证);MqAdminConsole 按 capabilities 展示 Topic、Consumer Group、消息、追踪、ACL、监控、Broker 等面板
注册与文档:更新 database-drivers.manifest.json、agent_catalog、集成检查脚本及 MQ 快速入门文档
同时将 Kafka / RocketMQ 共用的 flat MQ 上下文从 _kafka 统一为 _flat_mq。

变更类型

  • 新功能
  • Bug 修复
  • 性能优化
  • 代码重构
  • 文档更新
  • CI / 构建

涉及前端

  • 本 PR 涉及前端改动,已附截图/录屏(见下方)
image image image image image image image image image image image

验证

验证
Agent 构建与测试:

cd agents
./gradlew :rocketmq:shadowJar :rocketmq:test

Rust / 集成检查:

make cargo-check-fast
make cargo-test-fast
node scripts/check-mq-integration.mjs

前端测试:

pnpm test -- apps/desktop/src/lib/mq apps/desktop/src/lib/connection apps/desktop/src/stores/__tests__/connectionStore.mq.spec.ts

手动验证:

  1. 构建并安装 Agent JAR 到 DBX 数据目录 agents/drivers/rocketmq/agent.jar
  2. 新建 RocketMQ 连接(NameServer 127.0.0.1:9876)
  3. 验证控制台:Topic 列表/创建、Consumer Group 管理、消息查询、消息追踪、ACL、Broker 信息
  • make check 通过
  • make cargo-check-fast 通过
  • 相关测试通过

@github-actions

Copy link
Copy Markdown
Contributor

🌐 I18n autofill completed

✅ Added translations for 211 new zh-CN i18n keys.

Locale Added entries
es 211
it 211
ja 211
pt-BR 211
zh-TW 211

@aiLi0617 aiLi0617 changed the title Aili feat(rocketmq): 新增 RocketMQ Agent、适配器与管理控制台 Jul 20, 2026
renguoqiang and others added 3 commits July 20, 2026 13:55
# Conflicts:
#	agents/versions.json
#	apps/desktop/src/i18n/locales/es.ts
#	apps/desktop/src/i18n/locales/it.ts
#	apps/desktop/src/i18n/locales/ja.ts
#	apps/desktop/src/i18n/locales/pt-BR.ts
#	apps/desktop/src/i18n/locales/zh-TW.ts
#	crates/dbx-core/src/mq/adapters/kafka.rs
#	crates/dbx-core/src/mq/adapters/rocketmq.rs
#	crates/dbx-core/src/mq/service.rs
- 删除了 isKafkaMqConnection 函数及其相关逻辑
- 删除了 isRocketMqConnection 函数及其相关逻辑
- 简化了连接存储的相关代码结构

@t8y2 t8y2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request changes: RocketMQ 适配当前有三处会导致配置失效或数据不可见的问题,且该 head 目前仍与 main 冲突、没有相关 Rust/Agent/frontend CI 结果。

  1. agents/drivers/rocketmq/src/main/java/com/dbx/agent/rocketmq/RocketMqAgent.java:2101 对整个 namesrvAddr 使用 lastIndexOf(':') 取 host。RocketMQ 支持使用分号配置多个 NameServer,例如 ns1:9876;ns2:9876,这里会生成非法地址 ns1:9876;ns2:10911,所有需要 remap 的 Broker 管理请求都会失败。

    官方配置文档:https://rocketmq.apache.org/docs/bestPractice/01bestpractice/

    请正确解析地址列表(或要求显式 broker 映射),并增加多 NameServer 与 IPv6 覆盖。

  2. agents/drivers/rocketmq/src/main/java/com/dbx/agent/rocketmq/RocketMqAgent.java:1514 只从 UI 传入的 headers 中读取 TAGS,其余字段没有调用 Message.putUserProperty()。界面仍返回发送成功,但依赖 SQL92 自定义属性过滤的消费者将收不到消息。

    官方过滤文档:https://rocketmq.apache.org/docs/featureBehavior/07messagefilter/

    请保留非系统字段为 user properties,并增加发送/读取 round-trip 与 SQL92 过滤测试。

  3. crates/dbx-core/src/mq/adapters/rocketmq.rs:177 固定请求 limit: 200, offset: 0,随后丢弃 Agent 返回的 total;UI 也只调用一次。Topic 超过 200 条后,第 201 条及之后会永久不可见。

    请按 total 拉取后续页或贯通分页参数,并覆盖 200、201 和多页场景。

AiLi and others added 3 commits July 20, 2026 16:56
- 添加了通过 headers 设置消息 KEYS 的功能
- 实现了将非系统头复制为用户属性以支持 SQL92 过滤
- 添加了对 IPv6 地址和端口解析的支持
- 实现了 RocketMQ 代理的分页列表功能
- 添加了用于测试的消息发送和查看钩子方法
- 增加了对消息属性过滤的集成测试
- 改进了 broker 地址重映射逻辑
@aiLi0617
aiLi0617 requested a review from t8y2 July 20, 2026 10:30
@t8y2
t8y2 merged commit 574172f into t8y2:main Jul 20, 2026
9 checks passed
@t8y2

t8y2 commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution! Merged in 574172f, will be released in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants