@Override
    public void unRegister(ProviderConfig config) {
        String appName = config.getAppName();
        if (!registryConfig.isRegister()) {
            // registry ignored
            if (LOGGER.isInfoEnabled(appName)) {
                LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_REGISTRY_IGNORE));
            }
            return;
        }

        // unregister publisher
        if (config.isRegister()) {
            try {
                List<Instance> instances = providerInstances.remove(config);
                if (CommonUtils.isNotEmpty(instances)) {
                    for (Instance instance : instances) {
                        String serviceName = instance.getServiceName();
                        namingService.deregisterInstance(serviceName, instance);
                        if (LOGGER.isInfoEnabled(appName)) {
                            LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_ROUTE_REGISTRY_UNPUB,
                                serviceName, instances.size()));
                        }
                    }
                }

            } catch (Exception e) {
                if (!RpcRunningState.isShuttingDown()) {
                    if (e instanceof SofaRpcRuntimeException) {
                        throw (SofaRpcRuntimeException) e;
                    } else {
                        throw new SofaRpcRuntimeException(LogCodes.getLog(LogCodes.ERROR_UNREG_PROVIDER, EXT_NAME), e);
                    }
                }
            }
        }

    }
Instantiates a new Nacos registry.

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