Skip to content

Commit

Permalink
fix:fix multi register and discovery bug. (#268) (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyeBeFreeman authored Jan 30, 2023
1 parent f60aa51 commit c0fd23f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class ConsumerConfigImpl implements ConsumerConfig {
private List<DiscoveryConfigImpl> discoveries;

@JsonIgnore
private Map<String, DiscoveryConfigImpl> discoveryConfigMap = new ConcurrentHashMap<>();
private final Map<String, DiscoveryConfigImpl> discoveryConfigMap = new ConcurrentHashMap<>();

@Override
public LocalCacheConfigImpl getLocalCache() {
Expand Down Expand Up @@ -96,7 +96,7 @@ public List<DiscoveryConfigImpl> getDiscoveries() {
return discoveries;
}

public void setDiscoveries(List<DiscoveryConfigImpl> discoveries) {
private void setDiscoveryConfigMap(List<DiscoveryConfigImpl> discoveries) {
if (CollectionUtils.isNotEmpty(discoveries)) {
for (DiscoveryConfigImpl discoveryConfig : discoveries) {
if (discoveryConfigMap.containsKey(discoveryConfig.getServerConnectorId())) {
Expand All @@ -107,7 +107,6 @@ public void setDiscoveries(List<DiscoveryConfigImpl> discoveries) {
}
}
}
this.discoveries = discoveries;
}

@Override
Expand All @@ -134,6 +133,7 @@ public void verify() {
discoveryConfig.verify();
}
}
setDiscoveryConfigMap(discoveries);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class ProviderConfigImpl implements ProviderConfig {
private List<RegisterConfigImpl> registers;

@JsonIgnore
private Map<String, RegisterConfigImpl> registerConfigMap = new ConcurrentHashMap<>();
private final Map<String, RegisterConfigImpl> registerConfigMap = new ConcurrentHashMap<>();

@JsonProperty
private long minRegisterInterval;
Expand All @@ -70,7 +70,7 @@ public List<RegisterConfigImpl> getRegisters() {
return registers;
}

public void setRegisters(List<RegisterConfigImpl> registers) {
private void setRegisterConfigMap(List<RegisterConfigImpl> registers) {
if (CollectionUtils.isNotEmpty(registers)) {
for (RegisterConfigImpl registerConfig : registers) {
if (registerConfigMap.containsKey(registerConfig.getServerConnectorId())) {
Expand All @@ -81,7 +81,6 @@ public void setRegisters(List<RegisterConfigImpl> registers) {
}
}
}
this.registers = registers;
}

@Override
Expand All @@ -99,6 +98,7 @@ public void verify() {
registerConfig.verify();
}
}
setRegisterConfigMap(registers);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

<properties>
<!-- Project revision -->
<revision>1.10.1</revision>
<revision>1.10.2</revision>

<timestamp>${maven.build.timestamp}</timestamp>
<skip.maven.deploy>false</skip.maven.deploy>
Expand Down

0 comments on commit c0fd23f

Please sign in to comment.