tju-yxq opened a new pull request, #3168: URL: https://github.com/apache/rocketmq-dashboard/pull/3168
## What happened The DLQ group page made its latency worse than necessary in two places. Backend: - `RocketMQDLQProvider.listDLQGroups(...)` sliced the current page and then called `adminExt.examineTopicStats(dlqTopic)` for every `%DLQ%` topic serially. - With the default page size of 20, the page waited for up to 20 sequential admin RPCs. Slow brokers made this especially visible. Frontend: - The search input updated `search` state on every keystroke. - That state is in the group-loading effect's dependency list, so every character started a new backend group-list request. The request-generation guard prevented stale responses from overwriting newer data, but it did not prevent the redundant requests from being sent. ## Change Backend: - Load topic statistics for the current page on a bounded daemon thread pool with 8 workers. - Preserve the current deterministic page order by collecting futures in input order. - Cap each stats lookup at 5 seconds; cancel timed-out work. - Preserve row-level degradation: a failed or timed-out stats call only marks that row `UNAVAILABLE`. - Shut down the stats executor on bean destruction. Frontend: - Split visible search input from the search value used for requests. - Debounce typing by 300 ms. - Submit immediately when the user presses Enter or clicks the search action. - Clear pending debounce timers on unmount. Tests: - Backend test proves three simulated 150 ms stats calls complete in less than the serial sum, preserve order, and still call stats once per topic. - Frontend test proves two rapid keystrokes produce only one request and that the request uses the final search value. ## Verification Focused backend: ``` cd server mvn -q '-Dtest=RocketMQDLQProviderTest,DLQServiceTest,DLQControllerTest' test mvn -q checkstyle:check ``` Focused frontend: ``` cd web npm test -- DLQPage.test.tsx message.test.ts --run ``` Result: 3 files / 28 tests passed. Lint/build: ``` npm run lint -- --quiet npm run build ``` Lint reported 0 errors and 10 pre-existing warnings elsewhere. The production build completed successfully. `git diff --check` passed before commit. Production/config additions are 82 lines (48 backend, 34 frontend). This is the natural size of the bounded-executor and debounce change; no unrelated refactoring was added. Closes #3167 -- 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]
