Loyal-Young opened a new issue, #11260:
URL: https://github.com/apache/rocketmq/issues/11260

   ### Before Creating the Bug Report
   
   - [x] I inspected the current develop code and searched related issues/open 
pull requests.
   
   ### Summary
   
   MessageDecoder.createMessageId(ByteBuffer,ByteBuffer,long) hex-encodes the 
entire backing array. A larger reusable buffer creates an oversized ID, a slice 
includes bytes outside its range, and a direct buffer throws 
UnsupportedOperationException.
   
   ### Steps to Reproduce
   
   Create an IPv4 message ID using a 28-byte output buffer, a sliced buffer, or 
a direct buffer; each must equal the SocketAddress overload's 32-character ID.
   
   ### Expected Behavior
   
   Keep the existing exact-size heap-buffer fast path; otherwise encode only 
the bytes written into the selected buffer range without moving its position.
   
   ### Environment / Additional Context
   
   - Reproduced against develop commit 
`78b96bc5e21216cd7896efae08f90c5cde4cae53`.
   - Regression test: `MessageDecoderBufferIdTest`.
   - The regression fails before the fix and passes afterward on JDK 8.
   - Proposed change is limited to the existing implementation; no protocol or 
new API is introduced.
   
   


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