This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 188854c MigrationInvoker#doReSubscribe need to decide shoud or not
registry (#7753)
188854c is described below
commit 188854ce23fc0c5adb93d00d48156bf55bebc936
Author: wangxw666 <[email protected]>
AuthorDate: Wed May 19 09:44:45 2021 +0800
MigrationInvoker#doReSubscribe need to decide shoud or not registry (#7753)
* merge
* bugfix: service-discovery registry not judge
* bugfix: service-discovery registry not judge
* bugfix: service-discovery registry not judge
* bugfix: service-discovery registry not judge
---
.../apache/dubbo/registry/client/migration/MigrationInvoker.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationInvoker.java
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationInvoker.java
index b6ec32d..40a8cfd 100644
---
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationInvoker.java
+++
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationInvoker.java
@@ -145,9 +145,10 @@ public class MigrationInvoker<T> implements
MigrationClusterInvoker<T> {
Registry registry = directory.getRegistry();
registry.unregister(directory.getRegisteredConsumerUrl());
directory.unSubscribe(RegistryProtocol.toSubscribeUrl(oldSubscribeUrl));
- registry.register(directory.getRegisteredConsumerUrl());
-
- directory.setRegisteredConsumerUrl(newSubscribeUrl);
+ if (directory.isShouldRegister()) {
+ registry.register(directory.getRegisteredConsumerUrl());
+ directory.setRegisteredConsumerUrl(newSubscribeUrl);
+ }
directory.buildRouterChain(newSubscribeUrl);
directory.subscribe(RegistryProtocol.toSubscribeUrl(newSubscribeUrl));
}