From 2c6fbefe13a2c4821d28d367ee8d359472fbebba Mon Sep 17 00:00:00 2001 From: song <58645531+Song246@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:54:51 +0800 Subject: [PATCH] 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. --- .../springboot/starter/refresher/EtcdRefresherHandler.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/starters/threadpool/config/src/main/java/cn/hippo4j/config/springboot/starter/refresher/EtcdRefresherHandler.java b/starters/threadpool/config/src/main/java/cn/hippo4j/config/springboot/starter/refresher/EtcdRefresherHandler.java index b6979c9b..26064938 100644 --- a/starters/threadpool/config/src/main/java/cn/hippo4j/config/springboot/starter/refresher/EtcdRefresherHandler.java +++ b/starters/threadpool/config/src/main/java/cn/hippo4j/config/springboot/starter/refresher/EtcdRefresherHandler.java @@ -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); } }