elephone-184 opened a new pull request, #5035:
URL: https://github.com/apache/rocketmq-dashboard/pull/5035

   ## What is the purpose of the change
   
   When consumer groups fail repeatedly and messages enter Dead Letter Queues 
(`%DLQ%`), operators typically face hundreds or thousands of stranded messages. 
Blindly replaying DLQ messages often causes repetitive consumer crashes (e.g. 
for NullPointerException or schema parsing errors) or leads to duplicate 
execution for operations lacking idempotency.
   
   This PR introduces an automated `DLQFeatureClusteringEngine`:
   1. `DLQClusteringReportVO` & `DLQMessageClusterVO`: Domain report capturing 
message clusters grouped by origin topic and underlying exception signatures.
   2. `DLQFeatureClusteringEngine`: Parses real sampled `DLQMessageVO` headers, 
properties (`RETRY_TOPIC`, `REAL_TOPIC`), and stack traces to cluster failures, 
evaluating replay safety (`SAFE_TO_REPLAY`, `PERMANENT_SCHEMA_FAILURE`, 
`CAUTION_IDEMPOTENCY_RISK`). It recommends automatic replay for transient 
network/timeout issues while warning against code/schema defects.
   3. Controller & Service wiring: Integrates through 
`DLQService.clusterDLQMessages` and exposes 
`/api/dlq/{groupName}/cluster-analysis` in `DLQController`.
   4. Comprehensive unit test suite covering transient network errors, 
permanent schema failures, multi-signature buckets, and controller/service 
integration.
   
   ## Brief changelog
   
   - Add `DLQClusteringReportVO.java` domain model.
   - Add `DLQFeatureClusteringEngine.java` clustering and risk evaluation logic.
   - Add `clusterDLQMessages` method in `DLQService`.
   - Expose `/api/dlq/{groupName}/cluster-analysis` endpoint in `DLQController`.
   - Add `DLQFeatureClusteringEngineTest.java` and expand `DLQServiceTest.java` 
and `DLQControllerTest.java`.
   
   ## Verifying this change
   
   - `DLQFeatureClusteringEngineTest`: verifies exception parsing, origin topic 
extraction, and replay safety classification across multiple failure modes.
   - `DLQServiceTest`: verifies message sampling, delegation, and time window 
validation.
   - `DLQControllerTest`: verifies `/api/dlq/{groupName}/cluster-analysis` REST 
endpoint response mapping.


-- 
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]

Reply via email to