From de944ef2e6ea4d81f8a4c8bcafa6bde6008b0ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=88=E9=93=AD?= Date: Fri, 26 Jan 2024 10:14:56 +0800 Subject: [PATCH] support sofa registry kubernetes --- .../registry/kubernetes/KubernetesRegistry.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java b/registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java index 98d4fe2f5..ee660f18c 100644 --- a/registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java +++ b/registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java @@ -238,12 +238,14 @@ public void batchUnSubscribe(List configs) { @Override public void destroy() { - for (ProviderConfig providerConfig : providerInstances.keySet()) { - unRegister(providerConfig); - } - for (ConsumerConfig consumerConfig : consumerListeners.keySet()) { - unSubscribe(consumerConfig); - } + // unRegister provider + providerInstances.forEach((k, v) -> unRegister(k)); + providerInstances.clear(); + + // unRegister consumer + consumerListeners.forEach((k, v) -> unSubscribe(k)); + consumerListeners.clear(); + // close kubernetes client kubernetesClient.close(); }