yswwpp opened a new issue #2046: 使用Qos的一些问题 URL: https://github.com/apache/incubator-dubbo/issues/2046 在使用qos的时候发现22222端口始终没有被监听,调试才知道是启动qos服务的时候报错了,缺少netty相关的包,但是从日志中没有任何迹象。分析代码,类org.apache.dubbo.qos.protocol.QosProtocolWrapper中方法 ```java private void startQosServer(URL url) { if (!hasStarted.compareAndSet(false, true)) { return; } try { boolean qosEnable = Boolean.parseBoolean(url.getParameter(QOS_ENABLE,"true")); if (!qosEnable) { return; } int port = Integer.parseInt(url.getParameter(QOS_PORT,"22222")); boolean acceptForeignIp = Boolean.parseBoolean(url.getParameter(ACCEPT_FOREIGN_IP,"true")); Server server = Server.getInstance(); server.setPort(port); server.setAcceptForeignIp(acceptForeignIp); server.start(); } catch (Throwable throwable) { //throw new RpcException("fail to start qos server", throwable); } } ``` 其中 ```java Server server = Server.getInstance(); ```报错之后,到catch中,结果日志也没有、异常也没上抛!!! 报错的那段代码虽然简单,但是有netty的依赖关系,所以还是存在报错的可能,建议此处catch之后打印一个警告级别的日志,用户可以清晰的看到为什么qos服务没有启动。
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
