Skip to content

Commit

Permalink
fix qos failure in non-registry scenarios (apache#10199)
Browse files Browse the repository at this point in the history
* fix qos failure in non-registry scenarios

Signed-off-by: crazyhzm <crazyhzm@gmail.com>

* remove useless import

Signed-off-by: crazyhzm <crazyhzm@gmail.com>
  • Loading branch information
CrazyHZM authored Jun 24, 2022
1 parent c85195f commit d2d1b99
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@
import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.UrlUtils;
import org.apache.dubbo.qos.common.QosConstants;
import org.apache.dubbo.qos.server.Server;
import org.apache.dubbo.rpc.Exporter;
@@ -69,19 +68,13 @@ public int getDefaultPort() {

@Override
public <T> Exporter<T> export(Invoker<T> invoker) throws RpcException {
if (UrlUtils.isRegistry(invoker.getUrl())) {
startQosServer(invoker.getUrl());
return protocol.export(invoker);
}
startQosServer(invoker.getUrl());
return protocol.export(invoker);
}

@Override
public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException {
if (UrlUtils.isRegistry(url)) {
startQosServer(url);
return protocol.refer(type, url);
}
startQosServer(url);
return protocol.refer(type, url);
}

@@ -105,8 +98,8 @@ private void startQosServer(URL url) {
boolean qosEnable = url.getParameter(QOS_ENABLE, true);
if (!qosEnable) {
logger.info("qos won't be started because it is disabled. " +
"Please check dubbo.application.qos.enable is configured either in system property, " +
"dubbo.properties or XML/spring-boot configuration.");
"Please check dubbo.application.qos.enable is configured either in system property, " +
"dubbo.properties or XML/spring-boot configuration.");
return;
}

0 comments on commit d2d1b99

Please sign in to comment.