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

   ### Which Issue(s) This PR Fixes
   
   - Fixes #11510
   
   ### Brief Description
   
   Standalone deployments currently cannot disable the Fast Remoting or 
built-in HA listener independently. Add two startup options to `BrokerConfig`, 
both defaulting to `true` to preserve existing behavior:
   
   - `enableFastRemotingServer=false`: do not create the Fast server 
(`listenPort - 2`), and skip its processor registrations. Covers both ordinary 
brokers and per-broker sub-servers in BrokerContainer.
   - `enableHaListener=false`: do not bind or start the built-in HA acceptor. 
The outbound HA client, acknowledgement handling, and commit-log recovery are 
unchanged. `AutoSwitchHAService` inherits the same behavior.
   
   Both options require a broker restart. Clients must use the main endpoint 
when Fast Remoting is disabled; brokers that need inbound replication must keep 
the HA listener enabled. BrokerContainer's own management listeners are 
unchanged. No reflection or changes to replication-mode flags are used.
   
   ### How Did You Test This Change?
   
   - Linux, JDK 8: `mvn -B -T4 -pl container -am -DskipTests 
-Dmaven.test.skip=true package` passed, including Checkstyle and SpotBugs.
   - Existing regression tests passed: 
`BrokerControllerTest#testBrokerRestart`, `testCustomRemotingServer`, 
`testBrokerMetricsManagerInitialization`; `HATest#testHandleHA`, 
`testSemiSyncReplica` (5 tests, no failures/errors).
   - External real-socket harness exercised all four flag combinations for 
ordinary Broker and BrokerContainer (8 scenarios). Verified main/Fast/HA socket 
state, acceptor-thread state, shutdown, and 100 native Remoting sends/pulls per 
scenario; enabled Fast endpoints also accepted sends.
   - External HA harness verified 100 synchronously acknowledged messages 
replicated to a Slave with its HA listener disabled, AutoSwitch listener 
on/off, and successful startup with a disabled HA port already occupied.
   
   The external verification harnesses are not included in this PR.
   


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