Skip to content

Commit

Permalink
Fix tag
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ committed Jun 20, 2023
1 parent cc5b97d commit 5abfe0b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.TreeSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;
import java.util.UUID;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -99,6 +99,7 @@
import static org.apache.dubbo.config.Constants.DUBBO_PORT_TO_REGISTRY;
import static org.apache.dubbo.config.Constants.SCOPE_NONE;
import static org.apache.dubbo.registry.Constants.REGISTER_KEY;
import static org.apache.dubbo.registry.Constants.REGISTER_ORIGIN_KEY;
import static org.apache.dubbo.remoting.Constants.BIND_IP_KEY;
import static org.apache.dubbo.remoting.Constants.BIND_PORT_KEY;
import static org.apache.dubbo.remoting.Constants.IS_PU_SERVER_KEY;
Expand Down Expand Up @@ -321,7 +322,9 @@ public void register() {
}

for (Exporter<?> exporter : exporters) {
exporter.register();
if (exporter.getInvoker().getUrl().getParameter(REGISTER_ORIGIN_KEY, true)) {
exporter.register();
}
}
}
}
Expand Down Expand Up @@ -813,6 +816,7 @@ private URL exportRemote(URL url, List<URL> registryURLs, boolean register) {
@SuppressWarnings({"unchecked", "rawtypes"})
private void doExportUrl(URL url, boolean withMetaData, boolean register) {
if (!register) {
url = url.addParameter(REGISTER_ORIGIN_KEY, url.getParameter(REGISTER_KEY, true));
url = url.addParameter(REGISTER_KEY, false);
}
Invoker<?> invoker = proxyFactory.getInvoker(ref, (Class) interfaceClass, url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public interface Constants {
String REGISTER_IP_KEY = "register.ip";

String REGISTER_KEY = "register";
String REGISTER_ORIGIN_KEY = "register_origin";

String SUBSCRIBE_KEY = "subscribe";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
import static org.apache.dubbo.common.constants.RegistryConstants.EMPTY_PROTOCOL;
import static org.apache.dubbo.registry.Constants.CACHE;
import static org.apache.dubbo.registry.Constants.DUBBO_REGISTRY;
import static org.apache.dubbo.registry.Constants.REGISTER_KEY;
import static org.apache.dubbo.registry.Constants.REGISTRY_FILESAVE_SYNC_KEY;
import static org.apache.dubbo.registry.Constants.USER_HOME;

Expand Down Expand Up @@ -615,9 +614,6 @@ public void destroy() {
}

protected boolean acceptable(URL urlToRegistry) {
if (!registryUrl.getParameter(REGISTER_KEY, true)) {
return false;
}
String pattern = registryUrl.getParameter(ACCEPTS_KEY);
if (StringUtils.isEmpty(pattern)) {
return true;
Expand Down

0 comments on commit 5abfe0b

Please sign in to comment.