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

   …ctivity
   
   Extract the user property validation logic (property count limit, 
reserved-key check, control character check) from buildMessageProperty() into a 
standalone protected checkUserProperties() method. The property size 
accumulation stays in buildMessageProperty().
   
   This allows subclasses to customize validation (e.g. allow control 
characters in properties for specific scenarios) by overriding 
checkUserProperties() alone, instead of having to override the much larger 
buildMessageProperty() method.
   
   <!-- Please make sure the target branch is right. In most case, the target 
branch should be `develop`. -->
   
   ### Which Issue(s) This PR Fixes
   
   <!-- Please ensure that the related issue has already been created, and 
[link this pull request to that issue using 
keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>)
 to ensure automatic closure. -->
   
   - Fixes #11000 
   
   ### Brief Description
   
   SendMessageActivity#buildMessageProperty() (grpc v2 producer) inlines the 
validation of user properties — max property count, reserved system-property 
keys, and control-character checks — directly inside a large method. This 
proposal extracts that validation block into a small, standalone protected void 
checkUserProperties(Map<String, String> userProperties) method that 
buildMessageProperty() calls, so it can be overridden independently.
   
   
   <!-- Write a brief description for your pull request to help the maintainer 
understand the reasons behind your changes. -->
   
   ### How Did You Test This Change?
   
   <!-- In order to ensure the code quality of Apache RocketMQ, we expect every 
pull request to have undergone thorough testing. -->
   


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