Aias00 opened a new pull request, #10588:
URL: https://github.com/apache/rocketmq/pull/10588

   ### Which Issue(s) This PR Fixes
   
   Fixes #9195
   
   ### Brief Description
   
   `MessageBatch` encodes the inner message list via 
`MessageDecoder.encodeMessages(messages)`. If a caller sets a user property on 
the `MessageBatch` wrapper itself, that wrapper property is not part of the 
encoded inner messages and therefore is not visible after decoding or 
consumption.
   
   This PR makes `MessageBatch.putUserProperty(...)` propagate the user 
property to every inner message while still preserving the property on the 
wrapper. This keeps batch-level user property setters aligned with the payload 
that is actually encoded and consumed.
   
   The tests also cover the existing behavior where user properties already set 
on inner messages are preserved during batch encode/decode.
   
   ### How Did You Test This Change?
   
   - `mvn -pl common 
-Dtest=MessageEncodeDecodeTest,MessageBatchTest,MessageTest test`
   
   Result: `BUILD SUCCESS`, `Tests run: 17, Failures: 0, Errors: 0, Skipped: 0`


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