complone commented on PR #5000:
URL: https://github.com/apache/rocketmq/pull/5000#issuecomment-1236761698

   > > only way to find an available port is try to occupy a port using 0 and 
release it, but this approach is not thread-safe.
   > 
   > No, we should not use this approach. Modify the main source code to accept 
a configured listening port `0` and reflect/update the actual listening port in 
server-config objects. Use the config in test cases as we do in 
`RemotingServerTest`
   I think such 
[changes](https://github.com/apache/rocketmq/pull/5000/files#diff-ee85830d5ccf3051cea017b2ea12299dd9c282bade28bc50061490f963c5c1ffR77)
 are in line with expectations. In fact, the default value of 
nettyServerConfig.getListenPort is 0. We do not need to implement the method 
for netty port compatibility in NettyRemotingServer.
   


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