btlqql opened a new pull request, #10627: URL: https://github.com/apache/rocketmq/pull/10627
### Which Issue(s) This PR Fixes - Fixes #9725 ### Brief Description Proxy opens remoting channels to brokers on demand, but low-traffic channels can remain completely idle long enough to be closed. The next send or consume request then pays the connection re-establishment cost. The root cause is that Proxy has no lifecycle-managed keepalive for its already-established broker channels. This change: - exposes a backward-compatible snapshot API for active remoting channels; - filters configured and discovered NameServer channels before heartbeat delivery; - adds a lifecycle-managed Proxy-to-Broker heartbeat service covering messaging, operation, transaction, and lite-subscription clients; - sends lightweight one-way heartbeats only over existing active broker channels, so it neither discovers nor connects to idle brokers; - adds enable, interval, and timeout settings with startup validation; - prevents overlapping rounds, isolates client/channel failures, and records per-round operational statistics. The default 30-second interval is below the idle close window described in the issue. Existing custom `RemotingClient` implementations remain source/binary compatible through the default empty snapshot implementation. ### Impact Low-traffic Proxy deployments retain broker connections that are already in use, avoiding avoidable latency spikes on the next request. NameServer connections are excluded, no broker-wide fan-out is introduced, and the behavior can be disabled or tuned through `ProxyConfig`. ### How Did You Test This Change? Ran on JDK 8: `mvn -pl proxy -am test -Dtest=ProxyBrokerHeartbeatServiceTest,ProxyBrokerHeartbeatConfigTest,MQClientAPIExtTest,NettyRemotingClientTest -Dsurefire.failIfNoSpecifiedTests=false -Dspotbugs.skip=true -Djacoco.skip=true` Result: 11-module reactor build successful; 46 targeted tests passed with 0 failures, 0 errors, and 0 skipped. Checkstyle reported 0 violations. The reviewed diff contains 10 files and 983 added lines. -- 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]
