Skip to content

Commit 3dd4bfd

Browse files
authored
[ISSUE #9756] Fix the issue where the port is always 10911 when starting broker with brokerStartup
Change-Id: I0bbefa0a9d0079de6f3f4b9068b3ea586dbccfe0
1 parent 4a64a5a commit 3dd4bfd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

broker/src/main/java/org/apache/rocketmq/broker/BrokerStartup.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ public static ConfigContext configFileToConfigContext(String filePath) throws Ex
124124
NettyClientConfig nettyClientConfig = new NettyClientConfig();
125125
MessageStoreConfig messageStoreConfig = new MessageStoreConfig();
126126
AuthConfig authConfig = new AuthConfig();
127+
128+
nettyServerConfig.setListenPort(10911);
129+
messageStoreConfig.setHaListenPort(0);
130+
127131
Properties properties = new Properties();
128132
if (StringUtils.isNotBlank(filePath)) {
129133
systemConfigFileHelper.setFile(filePath);
@@ -161,9 +165,6 @@ public static BrokerController buildBrokerController(ConfigContext configContext
161165
AuthConfig authConfig = configContext.getAuthConfig();
162166
Properties properties = configContext.getProperties();
163167

164-
nettyServerConfig.setListenPort(10911);
165-
configContext.getMessageStoreConfig().setHaListenPort(0);
166-
167168
if (null == brokerConfig.getRocketmqHome()) {
168169
System.out.printf("Please set the %s variable in your environment " +
169170
"to match the location of the RocketMQ installation", MixAll.ROCKETMQ_HOME_ENV);

0 commit comments

Comments
 (0)