zmuxuny opened a new pull request, #5202:
URL: https://github.com/apache/rocketmq-dashboard/pull/5202

   ### Which Issue(s) This PR Fixes
   
   Fixes #5199
   
   ### Brief Description
   
   A valid physical message-ID request can locate the right message and then 
fail with 409 before direct consumption. RocketMQ's `viewMessage` decodes it as 
`MessageClientExt`, whose `getMsgId()` returns the producer `UNIQ_KEY` when 
present. Studio was treating that logical ID as its physical broker location.
   
   Use `MessageClientExt.getOffsetMsgId()` for the resolved message's target 
check and dispatch; retain `MessageExt.getMsgId()` for plain messages. The same 
validated physical ID reaches the SDK's direct-consume call. Request-ID, 
ownership, topic-route, actual-topic, and store-host checks remain in place.
   
   This follows the ID distinction already made by [RocketMQ 5.5.0's 
direct-consume 
implementation](https://github.com/apache/rocketmq/blob/rocketmq-all-5.5.0/tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java#L1322-L1332).
 Scope is the resolved SDK message's identity; initial logical-ID lookup 
interpretation and hostname topology matching are unchanged. No API, 
dependency, schema, or frontend change.
   
   ### How Did You Test This Change?
   
   - The initial regression uses the real RocketMQ 5.5.0 
`MessageDecoder.encode` / `clientDecode` path. It failed against unchanged 
production at the second target guard with `BusinessException: Message ID does 
not belong to a target cluster master`. The subsequent 63-case red provider run 
had exactly two new failures/errors and 61 passes.
   - Four added test methods cover decoded messages with and without 
`UNIQ_KEY`, null/malformed/foreign physical IDs without logical-ID fallback, 
and foreign request IDs rejected before lookup. Existing plain-message, 
ownership, actual-topic, store-host, offline-client, and other broker-failure 
coverage remains.
   - `mvn -B -ntp test 
-Dtest=RocketMQMessageProviderTest,ApacheInstanceProviderTest,MessageServiceTest,MessageControllerTest,ResourceOwnershipGuardTest,RuntimeAdminClientResolverTest,MqClientPoolTest`:
 **162 passed**, zero failures/errors. The final provider suite has 64 cases.
   - Broader backend run excluding the 13 datasource-dependent 
`@SpringBootTest` classes: **3,261 tests ran; 3,234 passed, 16 failed, 11 
errored**. All 27 failing/error cases are in unmodified `LlmConfigServiceTest` 
and `NotificationOutboxServiceTest`. A fresh clean `4ee173ad` worktree 
reproduced the exact same 27 case names, failure/error kinds, and exception 
types. This is not a full-suite pass.
   - `mvn -B -ntp -DskipTests package`: compilation, test compilation, JAR 
creation, and Spring Boot repackaging completed; the final binary-license gate 
failed. Clean `4ee173ad` reproduced the same 164 missing complete upstream 
LICENSE/COPYING artifact diagnostics. No packaging success is claimed.
   - Checkstyle: **zero violations**. `git diff --check`: passed. Independent 
diff and SDK-path review: no blocking findings.
   - Toolchain: Temurin 21.0.12.1 and Maven 3.9.11, with Mockito loaded as a 
startup Java agent. No live-broker, MySQL, frontend, or end-to-end test is 
claimed.
   
   The addresses and resource names in the tests are synthetic values extending 
the [existing public upstream test 
fixture](https://github.com/apache/rocketmq-dashboard/blob/4ee173ad71ae777f01111394a88358958b9abad6/server/src/test/java/org/apache/rocketmq/studio/provider/apache/RocketMQMessageProviderTest.java#L209-L249).
 They are not captured user infrastructure data.
   
   AI assistance was used; the source behavior, SDK distinction, deterministic 
regression, and final diff were reviewed.
   
   ### Checklist
   
   - [x] One coherent defect fix linked to an issue created before the 
production edit
   - [x] Conventional commit subject
   - [x] Regression test methods use the `Test` suffix
   - [x] Existing ASF headers retained; no new source files
   - [x] Verification results and baseline limitations disclosed
   - [x] No new UI text, dependency, or schema change
   


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