zhaohai666 opened a new pull request, #2513:
URL: https://github.com/apache/rocketmq-dashboard/pull/2513
# [Web] DLQ message details, selected re-send and Excel export
## Summary
The studio DLQ page only offered group-level statistics, a time-window bulk
re-delivery action and a
JSON export. Compared with the classic dashboard it was missing the two
most-used operations:
browsing the **individual dead-letter messages** of a group, and
**re-sending a single / selected
batch** of them. The JSON export also did not match the expected Excel
format. This PR closes that gap.
## Changes
### Backend
- **`DLQProvider`** (interface) and **`DLQProviderStub`**: three new
operations —
`listMessages` (paged details), `resendMessages` by `msgId` list, and
`exportExcel`.
- **`RocketMQDLQProvider`**:
- `listMessages` scans the `%DLQ%<group>` topic with a pull consumer
within the requested window
and returns a `PageResult<DLQMessageVO>` (msgId, topic, queueId, offset,
storeTime, keys, body).
- `resendMessages(msgIds, targetTopic)` scans the DLQ topic, filters the
selected messages by
msgId and re-sends each to its origin topic (or an explicit target) with
a short-lived producer,
reusing the existing `resendOne` logic (including origin-topic property
fallback).
- `exportExcel` streams the same scan into a real `.xlsx` workbook.
- **`DLQController`**: three new endpoints —
- `GET /api/dlq/{groupName}/messages` (paged details),
- `POST /api/dlq/resend-selected` (by msgId list, optional targetTopic),
- `GET /api/dlq/export-excel` (single message ids or the whole window,
returns `.xlsx`).
- **`DLQService`**: validation + Apache-only guard (cloud instances keep
`501`), plus
`resendSelectedMessages` and `exportExcel` delegation.
- New **`DLQMessageExcelRow`** (EasyExcel row model with formatted store
time) and
**`DLQResendSelectedRequestDTO`**.
- **`server/pom.xml`**: adds `com.alibaba:easyexcel:2.2.10` for `.xlsx`
generation.
### Frontend
- `api/message.ts`: `DLQMessage` / `DLQMessagePage` types and
`listDLQMessages`,
`resendDLQSelected`, `exportDLQExcel` API functions.
- `services/messageService.ts`: service wrappers (with mock fallbacks).
- `pages/instance/dlq.tsx`:
- The old "查看详情" stats dialog is replaced by a **message detail drawer**:
paged table of
dead-letter messages, row selection, single / batch re-send, and Excel
export of the selection
or the whole window.
- The row-level "导出" action now downloads `.xlsx` instead of `.json`.
## Tests
- `RocketMQDLQProviderTest` / `DLQServiceTest` / `DLQControllerTest` /
`DLQProviderStubTest`:
49 tests green, covering the new endpoints, paged detail validation and
provider delegation.
- `DLQPage.test.tsx`: updated the detail-dialog case to assert the new
drawer (including the
`listDLQMessages` call) and the Excel export path (`.xlsx` download via
the shared download util).
## Validation
- Frontend: `tsc -b` clean; `DLQPage.test.tsx` (14) green.
- Backend: `mvn -o checkstyle:check test
-Dtest="RocketMQDLQProviderTest,DLQServiceTest,DLQControllerTest,DLQProviderStubTest"`
—
49 tests green.
## Notes
- The existing time-window bulk re-send and group-level CSV export are kept
unchanged.
- Cloud instances still return `501` for DLQ detail / resend / Excel
operations
(`requireApacheInstance` guard), consistent with the rest of the DLQ
feature.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]