@Override
    public void unSubscribe(ConsumerConfig config) {
        if (config.isSubscribe()) {
            String serviceName = NacosRegistryHelper.buildServiceName(config, config.getProtocol());
            try {
                EventListener eventListener = consumerListeners.remove(config);
                if (null != eventListener) {
                    namingService.unsubscribe(serviceName, defaultCluster, eventListener);
                }
            } catch (Exception e) {
                if (!RpcRunningState.isShuttingDown()) {

                    if (e instanceof SofaRpcRuntimeException) {
                        throw (SofaRpcRuntimeException) e;
                    } else {
                        throw new SofaRpcRuntimeException(LogCodes.getLog(LogCodes.ERROR_UNSUB_LISTENER, EXT_NAME), e);
                    }
                }
            }

            providerObserver.removeProviderListener(config);
        }
    }
Instantiates a new Nacos registry.

@param registryConfig the registry config
registry/registry-nacos/src/main/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistry.java