You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "tju-yxq (via GitHub)" <gi...@apache.org> on 2026/09/05 04:10:02 UTC

[PR] fix(message): show backend message properties [rocketmq-dashboard]

tju-yxq opened a new pull request, #3290:
URL: https://github.com/apache/rocketmq-dashboard/pull/3290

   ## What happened
   
   The backend already returns message properties with every message record:
   
   ```java
   private Map<String, String> properties;
   private boolean propertiesTruncated;
   ```
   
   The Apache provider bounds this payload to 64 properties and 1,024 characters per value, and sets `propertiesTruncated` when that display contract shortens the payload.
   
   The frontend never showed it:
   
   - the Message Explorer detail modal displayed basic metadata and the body only;
   - queue-browser message cards showed Message ID, Tag, Key, store time, size, born host, and body;
   - the frontend `MessageRecord` type did not include `propertiesTruncated`.
   
   Operators therefore could not inspect trace flags, retry context, routing metadata, or business user properties in the UI even though the backend delivered them.
   
   ## Change
   
   - Add `propertiesTruncated` to the frontend message contract.
   - Show a bounded **消息属性** section in the message detail modal.
   - Show a **Properties** card in queue-browser message cards.
   - When the server shortened the payload, show a warning explaining that properties were truncated.
   - Keep body display and existing metadata unchanged.
   - Update message fixtures and add a regression test for property rendering and truncation.
   
   ## Verification
   
   Focused frontend:
   
   ```
   cd web
   npm test -- MessagePageAsyncState.test.tsx MessagePage.test.tsx QueueBrowser.test.tsx message.test.ts --run
   ```
   
   Result: 5 files / 45 tests passed.
   
   Lint/build:
   
   ```
   npm run lint -- --quiet
   npm run build
   ```
   
   Lint reported 0 errors and 10 pre-existing warnings elsewhere. The production build passed.
   
   `git diff --check` passed before commit.
   
   This is a 92-line frontend-only change. It is the natural size for surfacing data that the backend already returns; no unrelated backend or padding changes were added.
   
   Closes #3282
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(message): show backend message properties [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #3290: fix(message): show backend message properties
URL: https://github.com/apache/rocketmq-dashboard/pull/3290


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(message): show backend message properties [rocketmq-dashboard]

Posted by "tju-yxq (via GitHub)" <gi...@apache.org>.
tju-yxq commented on PR #3290:
URL: https://github.com/apache/rocketmq-dashboard/pull/3290#issuecomment-5584542902

   Thanks for the review. I checked the repository state and the review appears to have been evaluated against a different branch layout than the one this PR targets.
   
   This PR is based on the `rocketmq-studio` branch (current base: `0a596661`), where:
   
   - `web/src/api/message.ts` and the other changed paths do exist (`git cat-file -e rocketmq-studio:web/src/api/message.ts` succeeds);
   - there is no `frontend-new/` directory on this branch;
   - `propertiesTruncated` is part of the backend contract on this branch — `MessageRecordVO` (`server/src/main/java/org/apache/rocketmq/studio/instance/message/MessageRecordVO.java:45`) and `DLQMessageVO` define the field, and `RocketMQMessageProvider` (`:720`) / `RocketMQDLQProvider` (`:414`) set it when the bounded display payload is shortened.
   
   The paths and contracts described in the review (`frontend-new/src/pages/Message/message.jsx`, `frontend-new/src/components/MessageDetailViewDialog.jsx`, `src/main/java/org/apache/rocketmq/dashboard/model/MessageView.java`) match the repository's legacy `master` layout rather than `rocketmq-studio`.
   
   For reference, local validation on the `rocketmq-studio` base passed:
   
   - `npm test -- MessagePageAsyncState.test.tsx MessagePage.test.tsx QueueBrowser.test.tsx message.test.ts --run` — 45 tests passed
   - `npm run lint -- --quiet` — 0 errors
   - `npm run build` — passed
   
   Happy to make changes if there are concrete issues against the `rocketmq-studio` codebase itself.
   
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(message): show backend message properties [rocketmq-dashboard]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on code in PR #3290:
URL: https://github.com/apache/rocketmq-dashboard/pull/3290#discussion_r3939611035


##########
web/src/api/message.ts:
##########
@@ -14,6 +14,7 @@ export interface MessageRecord {
   bornHost: string;
   storeHost: string;
   properties: Record<string, string>;
+  propertiesTruncated?: boolean;

Review Comment:
   None of the changed paths exist in this repository or its git history (git log --all -- web/ is empty). The actual frontend is frontend-new/, a React JSX app (frontend-new/src/pages/Message/message.jsx, frontend-new/src/components/MessageDetailViewDialog.jsx), with no QueueBrowser component or queue-browser feature at all. This diff cannot be applied to apache/rocketmq-dashboard master and appears to target a different repository or fork; please rebase onto the real frontend layout.



##########
web/src/api/message.ts:
##########
@@ -14,6 +14,7 @@ export interface MessageRecord {
   bornHost: string;
   storeHost: string;
   properties: Record<string, string>;
+  propertiesTruncated?: boolean;

Review Comment:
   propertiesTruncated is not part of the backend contract. Message query endpoints return MessageView (src/main/java/org/apache/rocketmq/dashboard/model/MessageView.java:51), which exposes properties (Map<String,String>) but has no propertiesTruncated field, and no code anywhere in the repo bounds properties to 64 entries / 1,024 chars per value (grep for 'truncat' returns nothing). The truncation-warning UI and the regression test that sets propertiesTruncated: true exercise a field the server never sends, so that path is dead code in production and the PR description's backend claims are inaccurate.



##########
web/src/pages/instance/message.tsx:
##########
@@ -917,6 +920,37 @@ const MessagePageContent = ({
           <Typography.Title level={5} style={{ marginBottom: 8 }}>
             消息体
           </Typography.Title>
+          {messageProperties(selectedMsg).length > 0 && (

Review Comment:
   The PR premise ('the frontend never showed properties') is false for this repo: the message detail dialog already renders every property with copyable values in frontend-new/src/components/MessageDetailViewDialog.jsx:129-137, and the Message/Trace/Dlq pages already surface TAGS/KEYS from properties. If landed on the real frontend, this change would duplicate existing functionality rather than fix a gap.



##########
web/src/pages/instance/message.tsx:
##########
@@ -917,6 +920,37 @@ const MessagePageContent = ({
           <Typography.Title level={5} style={{ marginBottom: 8 }}>
             消息体
           </Typography.Title>
+          {messageProperties(selectedMsg).length > 0 && (
+            <>
+              <Typography.Title level={5} style={{ marginBottom: 8, marginTop: 24 }}>
+                消息属性
+              </Typography.Title>
+              {selectedMsg.propertiesTruncated && (
+                <Alert

Review Comment:
   Hardcoded Chinese strings ('消息属性', '服务端已截断消息属性') bypass the project's i18n layer (frontend-new/src/i18n/index.js already defines MESSAGE_PROPERTIES for zh/en). New UI copy should go through translations so the English locale is not broken.



##########
web/src/components/QueueBrowser.tsx:
##########
@@ -364,6 +368,34 @@ export const QueueBrowserResults = ({ state }: { state: QueueBrowserState }) =>
                           {entry.message.bornHost || '-'}
                         </Descriptions.Item>
                       </Descriptions>
+                      {messageProperties(entry.message).length > 0 && (
+                        <Card size="small" title="Properties" style={{ marginTop: 12 }}>
+                          {entry.message.propertiesTruncated && (

Review Comment:
   Minor code-quality nits if the target codebase existed: the messageProperties() helper is duplicated in QueueBrowser.tsx and message.tsx, and the QueueBrowser truncation Alert omits the explanatory description used in the modal, so the two truncation warnings are inconsistent.



-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org