moremind commented on code in PR #5598: URL: https://github.com/apache/shenyu/pull/5598#discussion_r1802967401
########## shenyu-admin/src/main/java/org/apache/shenyu/admin/listener/AbstractDataChangedListener.java: ########## @@ -278,68 +294,73 @@ public final void afterPropertiesSet() { * @param <T> the type of class * @param data the new config data */ - protected <T> void updateCache(final ConfigGroupEnum group, final List<T> data) { + protected <T> void updateCache(final ConfigGroupEnum group, final List<T> data, final String namespaceId) { String json = GsonUtils.getInstance().toJson(data); - ConfigDataCache newVal = new ConfigDataCache(group.name(), json, DigestUtils.md5Hex(json), System.currentTimeMillis()); + String configDataCacheKey = namespaceId + "_" + group.name(); Review Comment: use buildCacheKey ########## shenyu-admin/src/main/java/org/apache/shenyu/admin/listener/AbstractDataChangedListener.java: ########## @@ -98,14 +103,18 @@ public abstract class AbstractDataChangedListener implements DataChangedListener @Resource private DiscoveryUpstreamService discoveryUpstreamService; + @Resource + private NamespaceService namespaceService; + /** * fetch configuration from cache. * - * @param groupKey the group key + * @param groupKey the group key + * @param namespaceId the namespaceId * @return the configuration data */ - public ConfigData<?> fetchConfig(final ConfigGroupEnum groupKey) { - ConfigDataCache config = CACHE.get(groupKey.name()); + public ConfigData<?> fetchConfig(final ConfigGroupEnum groupKey, final String namespaceId) { + ConfigDataCache config = CACHE.get(namespaceId + "_" + groupKey.name()); Review Comment: use buildCacheKey method -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@shenyu.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org