RongtongJin opened a new issue, #9750:
URL: https://github.com/apache/rocketmq/issues/9750

   ### Before Creating the Enhancement Request
   
   - [x] I have confirmed that this should be classified as an enhancement 
rather than a bug/feature.
   
   
   ### Summary
   
   A potential NPE (Null Pointer Exception) issue exists in the transaction 
metrics recording logic in SendMessageProcessor.java when isAsyncSendEnable is 
configured to false.
   
   
   ### Motivation
   
   Problem Details:
   Location: 
broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java
 line 359
   Root Cause: In synchronous send mode (isAsyncSendEnable = false), the 
transaction metrics recording condition check is incomplete
   Specific Issue: When sendTransactionPrepareMessage is false, the code still 
attempts to access transaction-related metrics, potentially causing NPE
   Reproduction Steps:
   Configure isAsyncSendEnable = false
   Send non-transactional messages
   Observe logs for potential NPE occurrences
   Expected Behavior:
   Transaction metrics should only be recorded when processing transaction 
prepare messages, avoiding access to transaction-related services in 
non-transaction scenarios.
   Impact Scope:
   Message processing in synchronous send mode
   Accuracy of transaction metrics statistics
   System stability
   
   ### Describe the Solution You'd Like
   
   Fix NPE when isAsyncSendEnable is false in transaction metrics recording
   
   ### Describe Alternatives You've Considered
   
   No
   
   ### Additional Context
   
   No


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