diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java index ec125e37be5..1abd3831f92 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java @@ -258,7 +258,7 @@ public void doUnsubscribe(URL url, NotifyListener listener) { appSubscriptionLock.lock(); ServiceInstancesChangedListener instancesChangedListener = serviceListeners.get(serviceNamesKey); if (instancesChangedListener != null) { - instancesChangedListener.removeListener(protocolServiceKey, listener); + instancesChangedListener.removeListener(url.getServiceKey(), listener); if (!instancesChangedListener.hasListeners()) { instancesChangedListener.destroy(); serviceListeners.remove(serviceNamesKey);