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

   ### Which Issue(s) This PR Fixes
   
   Fixes #10692
   
   ### Brief Description
   
   `HAProxyMessageForwarder.buildHAProxyMessage` previously parsed source and 
destination ports with `Integer.parseInt` directly, both from proxy protocol 
attributes and from channel remote/local addresses. A malformed port could 
throw `NumberFormatException` and fail HAProxy message forwarding with a 
runtime parsing exception.
   
   This PR adds safe port parsing. Invalid port values now make 
`buildHAProxyMessage` return `null`, matching the existing behavior for 
unavailable HAProxy message data, while valid port values keep the existing 
behavior.
   
   The test also replaces Java `assert` statements with JUnit assertions in 
`HAProxyMessageForwarderTest`.
   
   ### How Did You Test This Change?
   
   ```bash
   mvn -pl proxy -Dtest=HAProxyMessageForwarderTest -DfailIfNoTests=false test
   ```
   
   Result: `BUILD SUCCESS`, `Tests run: 3, 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