Skip to content

Commit

Permalink
fix: Fix the problem that dynamic refresh does not take effect when u…
Browse files Browse the repository at this point in the history
…sing Etcd as the registry center in Config mode. (#1550)

* Extract the Consul default-context field as a constant

* fix:Fix the problem that dynamic refresh does not take effect when using Etcd as the registry center in Config mode.
  • Loading branch information
Song246 authored Jun 13, 2024
1 parent d77efe1 commit 2c6fbef
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ public void registerListener() {
public void onNext(WatchResponse response) {
WatchEvent watchEvent = response.getEvents().get(0);
WatchEvent.EventType eventType = watchEvent.getEventType();
// todo Currently only supports json
if (Objects.equals(eventType, WatchEvent.EventType.PUT)) {
KeyValue keyValue1 = watchEvent.getKeyValue();
String value = keyValue1.getValue().toString(charset);
Map map = JSONUtil.parseObject(value, Map.class);
dynamicRefresh(keyValue1.getKey().toString(charset), map);
dynamicRefresh(value);
}
}

Expand Down

0 comments on commit 2c6fbef

Please sign in to comment.