@Override
    public void unRegister(ProviderConfig config) {

        String appName = config.getAppName();

        if (!registryConfig.isRegister()) {
            if (LOGGER.isInfoEnabled(appName)) {
                LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_REGISTRY_IGNORE));
            }
            return;
        }
        if (!config.isRegister()) {
            return;
        }

        try {
            List<InstanceRegisterRequest> instanceRegisterRequests = buildPolarisRegister(config);

            for (InstanceRegisterRequest request : instanceRegisterRequests) {
                deregisterPolarisService(config, request);
            }

        } catch (Exception e) {
            if (!RpcRunningState.isShuttingDown()) {
                if (e instanceof SofaRpcRuntimeException) {
                    throw e;
                } else {
                    throw new SofaRpcRuntimeException(LogCodes.getLog(LogCodes.ERROR_UNREG_PROVIDER, EXT_NAME), e);
                }
            }
        }
    }
the main logic of polaris registry, similar to consul

@author <a href=mailto:bner666@gmail.com>ZhangLibin</a>
registry/registry-polaris/src/main/java/com/alipay/sofa/rpc/registry/polaris/PolarisRegistry.java