fix: Fix the problem that dynamic refresh does not take effect when using 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.
pull/1551/head
song 5 months ago committed by GitHub
parent d77efe1f6b
commit 2c6fbefe13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -77,12 +77,10 @@ public class EtcdRefresherHandler extends AbstractConfigThreadPoolDynamicRefresh
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);
}
}

Loading…
Cancel
Save