zhaohai666 opened a new pull request, #2063: URL: https://github.com/apache/rocketmq-dashboard/pull/2063
# PR: feat(proxy,dlq): live proxy topology/health view and dead-letter message export **Branch:** `feature/studio-proxy-topology-dlq-export` **Commit:** `a91e5199` — pushed to `origin/feature/studio-proxy-topology-dlq-export` **Base:** `apache:rocketmq-studio` @ `098e2ea4` **PR create link:** https://github.com/zhaohai666/rocketmq-dashboard/pull/new/feature/studio-proxy-topology-dlq-export ## Summary Closes two RIP-1 BASE-01 gaps from `docs/rip-gap-analysis-2026-08-13.md`: **Proxy topology/health view** (BASE-01 C — previously the proxy page only listed addresses with no runtime signal) and **DLQ export** (BASE-01 K — previously DLQ messages could only be resent, never exported). ## Changes ### 1. Proxy topology / health view (BASE-01 C) Backend: - **`ProxyTopologyVO`** — per-node view: `proxyAddr`, `status` (UP / PARTIAL / DOWN), gRPC port, derived remoting port, reachability flags, probe latency. - **`ProxyHealthProbe`** (interface) + **`SocketProxyHealthProbe`** (default implementation) — TCP connect probe with a 2s timeout; abstracted so the service is unit-testable without opening sockets. - **`ProxyAddressService.buildTopology()`** — probes every registered proxy on its gRPC port and, for the well-known 5.0 `8080/8081` pairing, the remoting port too. Status: gRPC reachable → UP; only remoting reachable → PARTIAL; neither → DOWN. Non-standard ports do not assume a remoting counterpart. - **`GET /api/proxies/topology`** — controller endpoint returning the view. Frontend: - **`api/proxy.ts`** — adds `ProxyTopologyNode` + `getProxyTopology()`. - **`Proxy.tsx`** — overlays the live status onto the node list (UP→healthy, PARTIAL→warning, DOWN→unhealthy); probing is best-effort and falls back to the previous "unknown" status when unavailable. ### 2. Dead-letter message export (BASE-01 K) Backend: - **`DLQProvider.exportMessages(...)`** — scans the `%DLQ%<group>` topic reusing the existing offset-legal-aware pull scan (`collectDeadLetters`, now parameterized with a per-call cap) and maps each message to **`DLQMessageVO`** (`msgId`, `topic`, `queueId`, `offset`, `storeTime`, `keys`, UTF-8 `body` best-effort + lossless `bodyBase64`). - **`GET /api/dlq/export?instanceId=&groupName=&startTime=&endTime=&maxCount=`** — returns the message list as a JSON attachment (`Content-Disposition: attachment; filename="dlq-<group>.json"`); `DLQService` validates the request (same rules as resend). `maxCount` is capped at 5000. - **`DLQProviderStub`** — explicit 501 fallback for the new method. Frontend: - **`api/message.ts` / `services/messageService.ts`** — add `exportDLQMessages()` (blob download, mock-safe). - **`dlq.tsx`** — the per-row "导出" button now downloads the dead-letter messages as JSON (`<group>-dlq-messages.json`); the batch export button keeps the CSV summary behavior. ## Verification - Backend suite — **1061/1061 green**: - `ProxyAddressServiceTest` 12/12 (ctor updated for the injected probe; new UP/PARTIAL/DOWN topology cases + non-standard port case), - `ProxyControllerTest` 8/8 (new topology endpoint), - `RocketMQDLQProviderTest` 10/10 (new export mapping + cap-fallback cases), - `DLQControllerTest` 8/8 (new export attachment case), - `DLQProviderStubTest` 3/3 (new export stub case), - `DLQServiceTest` 8/8. - Frontend — `tsc -b` clean, `eslint` clean on changed files, DLQPage 12/12 and Proxy 7/7 green. ### Bonus fix (upstream regression) `MultiBackendMetricsSourceTest` failed on hosts without a site-local IPv4: the test server fell back to loopback, which the SSRF guard (`UrlHostGuard`, merged in #1673) rejects. The address fallback now prefers any non-loopback IPv4 before loopback, so the metrics suite passes everywhere. Not introduced by this PR — verified the metrics sources are untouched here. ## Notes - No behavior change for existing endpoints (`/api/proxies`, `/api/dlq/resend`). - The `DLQPage.test.tsx` CSV-export tests were updated: the per-row export now covers the JSON message export, and the CSV formula-neutralization coverage moved to the batch-export path. -- 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]
