lizhimins commented on code in PR #11511:
URL: https://github.com/apache/rocketmq/pull/11511#discussion_r4548371130
##########
broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java:
##########
@@ -536,24 +536,20 @@ public void setBrokerMetricsManager(BrokerMetricsManager
brokerMetricsManager) {
protected void initializeRemotingServer() throws
CloneNotSupportedException {
NettyRemotingServer tcpRemotingServer = new
NettyRemotingServer(this.nettyServerConfig, this.clientHousekeepingService);
- NettyServerConfig fastConfig = (NettyServerConfig)
this.nettyServerConfig.clone();
-
- int listeningPort = nettyServerConfig.getListenPort() - 2;
- if (listeningPort < 0) {
- listeningPort = 0;
- }
- fastConfig.setListenPort(listeningPort);
-
- NettyRemotingServer fastRemotingServer = new
NettyRemotingServer(fastConfig, this.clientHousekeepingService);
-
- // Set RemotingMetricsManager on both remoting servers
if (this.brokerMetricsManager != null) {
tcpRemotingServer.setRemotingMetricsManager(this.brokerMetricsManager.getRemotingMetricsManager());
-
fastRemotingServer.setRemotingMetricsManager(this.brokerMetricsManager.getRemotingMetricsManager());
}
-
remotingServerMap.put(TCP_REMOTING_SERVER, tcpRemotingServer);
- remotingServerMap.put(FAST_REMOTING_SERVER, fastRemotingServer);
+
+ if (this.brokerConfig.isEnableFastRemotingServer()) {
+ NettyServerConfig fastConfig = (NettyServerConfig)
this.nettyServerConfig.clone();
+ fastConfig.setListenPort(Math.max(0,
nettyServerConfig.getListenPort() - 2));
Review Comment:
这里很奇怪
--
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]