tju-yxq opened a new pull request, #1413: URL: https://github.com/apache/rocketmq-dashboard/pull/1413
## What is the purpose of the change Fixes #1411 The message trace query used a hardcoded 1-hour lookback window (`now - ONE_HOUR_MILLIS`). Traces for messages produced more than 1 hour ago were silently lost, returning an empty trace graph even though the trace data still exists on the broker (default retention is 72 hours). ## Brief changelog - **`RocketMQMessageProvider.java`**: Added `resolveMessageStoreTimestamp()` helper that fetches the message's `storeTimestamp` via `adminExt.viewMessage(msgId)`. - **`RocketMQMessageProvider.java`**: Modified `getMessageTrace()` to derive the trace query window from the message's store timestamp instead of the current time. `begin` is set to `storeTimestamp - 5min` and `end` to `max(storeTimestamp + 24h, now + 1min)`. - **Fallback**: If the message cannot be located (expired, wrong ID), the existing 1-hour window is used with a warning log. ## Verifying this change 1. Produce a message and wait 2 hours. 2. Query the message by ID or topic + time range (message is found). 3. Click "View Trace". 4. Before fix: empty trace graph (trace data exists but query window doesn't cover it). 5. After fix: trace graph shows all trace nodes. - [x] Make sure there is a Github issue filed for the change. - [x] Format the pull request title like `[ISSUE #1411] ...`. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit-test to verify your logic correction. - [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. - [ ] If this contribution is large, please file an Apache Individual Contributor License Agreement. -- 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]
