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 907c6c5 [Dubbo-7459]Fix passing wrong parameter when calling
MigrationInvoker.compareAddresses() (#7460)
907c6c5 is described below
commit 907c6c5990d3dcdb7eb08b163d765c146edd1f85
Author: Wu Zhiguo <[email protected]>
AuthorDate: Tue Mar 30 11:18:39 2021 +0800
[Dubbo-7459]Fix passing wrong parameter when calling
MigrationInvoker.compareAddresses() (#7460)
* use constant RegistryConstants.INIT
* fix wrong parameter when calling MigrationInvoker.compareAddresses()
---
.../org/apache/dubbo/rpc/cluster/support/migration/MigrationRule.java | 4 +++-
.../org/apache/dubbo/registry/client/migration/MigrationInvoker.java | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/migration/MigrationRule.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/migration/MigrationRule.java
index caedf8c..92e34c4 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/migration/MigrationRule.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/migration/MigrationRule.java
@@ -24,6 +24,8 @@ import org.yaml.snakeyaml.constructor.Constructor;
import java.util.Optional;
+import static org.apache.dubbo.common.constants.RegistryConstants.INIT;
+
public class MigrationRule {
private static final String DUBBO_SERVICEDISCOVERY_MIGRATION_KEY =
"dubbo.application.service-discovery.migration";
public static final String DUBBO_SERVICEDISCOVERY_MIGRATION_GROUP =
"MIGRATION";
@@ -60,7 +62,7 @@ public class MigrationRule {
return getMigrationRule(null);
}
- if (StringUtils.isBlank(rawRule) || "INIT".equals(rawRule)) {
+ if (StringUtils.isBlank(rawRule) || INIT.equals(rawRule)) {
String step =
(String)configuration.getInternalProperty(DUBBO_SERVICEDISCOVERY_MIGRATION_KEY);
return getMigrationRule(step);
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 fa844c5..2139d3b 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
@@ -112,10 +112,10 @@ public class MigrationInvoker<T> implements
MigrationClusterInvoker<T> {
refreshServiceDiscoveryInvoker();
refreshInterfaceInvoker();
setListener(invoker, () -> {
- this.compareAddresses(invoker, serviceDiscoveryInvoker);
+ this.compareAddresses(serviceDiscoveryInvoker, invoker);
});
setListener(serviceDiscoveryInvoker, () -> {
- this.compareAddresses(invoker, serviceDiscoveryInvoker);
+ this.compareAddresses(serviceDiscoveryInvoker, invoker);
});
} else {
refreshServiceDiscoveryInvoker();