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

   ### Which Issue(s) This PR Fixes
   
   Fixes #5106.
   
   ### Brief Description
   
   `getMessageTraceByKey` treated a trace-topic key hit as already scoped to 
one business key. RocketMQ 5.5.0 `TraceDataEncoder` appends every context for 
one source topic into the same trace message and indexes each business-key 
token (`keys.split(MessageConst.KEY_SEPARATOR)`, one space) plus each message 
id. A lookup for `order-A` therefore returned `order-B` and `order-A-suffix` 
from that body, including their failed consumption.
   
   Key lookup now keeps a context only when its keys column contains the query 
as a whole token. `order-A` matches `extra order-A` and does not match 
`order-A-suffix`. Pub, EndTransaction, and SubBefore store keys at index 7; 
SubAfter stores them at index 5. Recall has no keys column, so a key lookup 
skips it. Message-id lookup still passes a null key and keeps the existing 
message-id filter.
   
   ### How Did You Test This Change?
   
   - Before the fix, a probe that encodes the mixed batch with production 
`TraceDataEncoder` and mocks `queryMessage` returned 6 nodes and consumer 
groups `consumer-a`, `consumer-b`, and `consumer-prefix`.
   - After the fix, the same probe returns 3 nodes and only `consumer-a`.
   - `RocketMQMessageProviderTest`: 59 tests, 0 failures, checkstyle 0 
violations. The new test covers the mixed batch for key `order-A`, key 
`order-A-suffix`, message id `msg-b`, and message id `msg-recall`. The existing 
shared-key test still returns both contexts that carry that key.
   
   No live NameServer, broker, or browser run. `queryMessage` is mocked after 
production encoding.
   
   ```bash
   mvn -B -ntp -Dtest=RocketMQMessageProviderTest test
   ```
   
   Prepared with AI assistance.
   


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