apache / apache/rocketmq-dashboard
[Studio][Feature] Show the redelivery count on the message detail panel
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 683
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 58
Description
## 1. 需求与来源
消息详情面板应显示消息的重投次数(reconsumeTimes)。来源:
- 父项目(master 经典版)消息详情弹窗已展示 `ReconsumeTimes`:`frontend-new/src/components/MessageDetailViewDialog.jsx` L120(perma-link:[770822bb](https://github.com/apache/rocketmq-dashboard/blob/770822bb/frontend-new/src/components/MessageDetailViewDialog.jsx#L120))。
- 语义:消息被消费组重投过(reconsumeTimes > 0)意味着该副本至少经历一次消费失败,是消息元数据中最直接的健康信号。
## 2. Use case
在消息页检查某条消息时,希望直接看到它携带的重投计数,以判断消费端是否反复失败。当前 Studio 消息详情弹窗不显示该信息;消息轨迹 Tab 虽有"重试次数"列,但仅对开启轨迹的 Topic 有数据(Apache provider 的轨迹重试次数当前恒为 0),详情面板没有任何位置呈现该值。
## 3. Importance
后端扫描/查看消息时直接持有 `MessageExt`(rocketmq-common 5.5.0 `getReconsumeTimes()`,字节码亲验),`RocketMQMessageProvider.toRecordVO` 是全部消息查询路径(按 Topic/按 Key/按 msgId/队列浏览)的统一 VO 映射点,补一个字段即全链路生效。数据已在手,仅缺 VO 字段与展示。
## 4. Expected behavior / acceptance criteria
- `MessageRecordVO` 新增 `reconsumeTimes`,由 MessageExt.getReconsumeTimes() 填充(未重投为 0)。
- 消息详情弹窗(消息内容 Tab)在"大小"后新增"重投次数"项;字段缺失(如演示数据)显示 `-` 占位。
- 语义边界(如实声明):重投副本存储于 `%RETRY%` 主题,broker 索引按存储主题键控(rocketmq-store 5.5.0 `IndexService.buildIndex`/`buildKey` 源码核实),按原始 Topic/Key 查询命中的原始主题副本通常为 0——该值用于父项目对齐与"此副本从未被重投"的确认,真实重投次数的分诊场景见 DLQ 表面(#4268)。
- 测试:provider 层断言 toRecordVO 映射 reconsumeTimes;前端详情断言新行渲染。
## 5. Related PR
Fix: #4271.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with MessageRecordVO and RocketMQMessageProvider.toRecordVO, then inspect the Studio message detail panel and its existing size row. Add coverage for the reconsumeTimes mapping and for rendering the new detail row, including the '-' fallback. Done means MessageExt.getReconsumeTimes() reaches the VO and the message content tab displays the value after size.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, javascript
- Domain
- backend, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100