-
Notifications
You must be signed in to change notification settings - Fork 929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
triple协议如何能够配置随机端口呢?同一台机器部署多个相同服务,端口会重复,java中协议端口可以允许-1端口随机分配 #2382
Comments
Thank you for reporting this. Firstly, the documentation you referenced is from Dubbo, not Dubbo-go. Therefore, the default port is not the same as the Dubbo's. Then, the condition of using ramdon port doesn't have problem, since the port should be specified to |
@justxuewei Thank you your reply, But use "-1" in port field of string type, the length size is greater than 0, if i keep empty the field default is "20000", there you are set the "default" tag value "20000", please give a simple of how to use random port? thank you very much |
Protocol Init method https://github.com/apache/dubbo-go/blob/main/config/protocol_config.go https://github.com/creasty/defaults/blob/master/defaults.go the code you are parse "default" tag, Port default "20000" my dubbogo.yaml config
|
The condition of assigning a random port for protocols should be that port is less than or equal to 0, not the length of the port string. Fixes: apache#2382 Signed-off-by: Xuewei Niu <[email protected]>
Thanks for report this issue. I've pushed a patch to fix the issue: #2384. Please let me know if you have any questions. |
Ok, thank you, i will let you know if i meet any question in use. |
Fixes #2382. The condition of assigning a random port for protocols should be that port is less than or equal to 0, not the length of the port string.
感觉是判断-1才特殊处理?现在无法解析就随机分配 无法解析结束进程panic感觉比较合理 |
调整代码
不要默认值是不是才能通过后面逻辑?,否则后面判断端口逻辑是无效的?
The text was updated successfully, but these errors were encountered: