btlqql opened a new pull request, #4702:
URL: https://github.com/apache/rocketmq-dashboard/pull/4702
<!-- Base branch: `rocketmq-studio`, the RocketMQ Studio trunk. -->
### Brief Description
#4267 ("show storage location and redelivery counts") added
`DLQMessageVO.reconsumeTimes` and the
retry-count column on the DLQ page (`web/src/pages/instance/dlq.tsx`). The
dead-letter exports were
not kept in sync:
- `GET /api/dlq/export` serializes `DLQMessageVO` directly, so the JSON
export carries the field;
- `GET /api/dlq/export-excel` maps every message through
`DLQMessageExcelRow.from`, whose column set
stopped at `Body`, so the count the operator just saw on the page was
silently dropped from the
`.xlsx` file used for offline triage of a backlog.
```java
// DLQMessageExcelRow.java (before): no redelivery column, and from() copied
every other
// DLQMessageVO field the page shows.
@ExcelProperty("Store Time")
private String storeTime;
@ExcelProperty("Keys")
private String keys;
```
The row model now carries `Reconsume Times` between `Store Time` and `Keys`,
mirroring the field
order of `DLQMessageVO`, and `from()` copies it. Column order of the
existing columns is unchanged.
Free-form user properties stay out of the sheet on purpose: flattening a
`Map` into a cell needs a
serialization rule of its own and is not part of this fix.
### How Did You Test This Change?
New `DLQMessageExcelRowTest` writes a dead-letter row (`reconsumeTimes = 3`)
through EasyExcel,
reads the workbook back and asserts the header/column mapping.
Before the fix (red) - the workbook round trip succeeds, but the column does
not exist:
```
$ cd server && mvn -B -ntp test -Dtest=DLQMessageExcelRowTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed:
1.807 s <<< FAILURE! -- in
org.apache.rocketmq.studio.instance.dlq.DLQMessageExcelRowTest
[ERROR] DLQMessageExcelRowTest.shouldExportTheMessageRedeliveryCountTest:49
Expecting map:
{"Body"="payload", "Keys"="order-1", "Message ID"="msg-1", "Offset"="17",
"Queue ID"="7", "Store Time"="2023-11-15 06:13:20", "Topic"="%DLQ%group-1"}
to contain entries:
["Reconsume Times"="3"]
but could not find the following map entries:
["Reconsume Times"="3"]
```
After the fix (green), together with the neighbouring DLQ classes:
```
$ cd server && mvn -B -ntp test
-Dtest='DLQMessageExcelRowTest,DLQServiceTest,DLQControllerTest'
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 -- in
org.apache.rocketmq.studio.instance.dlq.DLQMessageExcelRowTest
[INFO] Tests run: 17, Failures: 0, Errors: 0, Skipped: 0 -- in
org.apache.rocketmq.studio.instance.dlq.DLQServiceTest
[INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0 -- in
org.apache.rocketmq.studio.instance.dlq.DLQControllerTest
[INFO] Tests run: 42, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS
```
`mvn test` runs checkstyle in the `validate` phase: `You have 0 Checkstyle
violations.`
Note on the full suite: on a clean `rocketmq-studio` checkout `mvn -B -ntp
test` already reports
`Tests run: 3051, Failures: 6, Errors: 25, Skipped: 4`. The 11 red classes
are the MySQL 8 backed
Spring integration tests (`AuthServiceBootstrapIntegrationTest`,
`AuthServiceConcurrencyIntegrationTest`,
`AuthServiceSessionOverviewIntegrationTest`,
`HealthProbeIntegrationTest`, `QueryHistoryServiceIntegrationTest`,
`NativeAlertEvaluationTransactionTest`,
`NotificationOutboxMapperIntegrationTest`,
`RmqAlertStateMapperIntegrationTest`, `StudioApplicationTest`) plus the
external-CLI ones
(`CliAgentProviderTest`, `ClaudeCodeAgentProviderTest`). None of them are
touched by this change.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`fix:`)
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
(no UI text in this change)
- [x] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [x] New source files carry the ASF license header
(`DLQMessageExcelRowTest.java`)
- [x] Documentation touched where behaviour changed (exported column added
to the Excel export)
--
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]