class NacosConfigAdapter extends ConfigAdapter {
    private ExecutorService executorService = DiscoveryThreadPoolFactory.getExecutorService("nacos-config");

    @Autowired
    private NacosOperation nacosOperation;

    private Listener partialListener;
    private Listener globalListener;

    @Override
    public String getConfig(String group, String dataId) throws Exception {
        return nacosOperation.getConfig(group, dataId);
    }

    @PostConstruct
    @Override
    public void subscribeConfig() {
        partialListener = subscribeConfig(false);
        globalListener = subscribeConfig(true);
    }

    private Listener subscribeConfig(boolean globalConfig) {<FILL_FUNCTION_BODY>}

    @Override
    public void unsubscribeConfig() {
        unsubscribeConfig(partialListener, false);
        unsubscribeConfig(globalListener, true);

        executorService.shutdownNow();
    }

    private void unsubscribeConfig(Listener listener, boolean globalConfig) {
        if (listener == null) {
            return;
        }

        String group = getGroup();
        String dataId = getDataId(globalConfig);

        logUnsubscribeStarted(globalConfig);

        try {
            nacosOperation.unsubscribeConfig(group, dataId, listener);
        } catch (Exception e) {
            logUnsubscribeFailed(e, globalConfig);
        }
    }

    @Override
    public ConfigType getConfigType() {
        return ConfigType.NACOS;
    }
}

        String group = getGroup();
        String dataId = getDataId(globalConfig);

        logSubscribeStarted(globalConfig);

        try {
            return nacosOperation.subscribeConfig(group, dataId, executorService, new NacosSubscribeCallback() {
                @Override
                public void callback(String config) {
                    callbackConfig(config, globalConfig);
                }
            });
        } catch (Exception e) {
            logSubscribeFailed(e, globalConfig);
        }

        return null;
    
<methods>public non-sealed void <init>() ,public void callbackConfig(java.lang.String, boolean) ,public void fireRuleCleared(com.nepxion.discovery.plugin.framework.event.RuleClearedEvent, boolean) ,public void fireRuleUpdated(com.nepxion.discovery.plugin.framework.event.RuleUpdatedEvent, boolean) ,public java.lang.String getConfig(boolean) throws java.lang.Exception,public abstract java.lang.String getConfig(java.lang.String, java.lang.String) throws java.lang.Exception,public java.lang.String[] getConfigList() throws java.lang.Exception,public java.lang.String getDataId(boolean) ,public java.lang.String getGroup() ,public java.lang.String getServiceId() ,public com.nepxion.discovery.common.entity.SubscriptionType getSubscriptionType(boolean) ,public boolean isConfigSingleKey() ,public void logClearedEvent(boolean) ,public void logFound(boolean) ,public void logGetStarted(boolean) ,public void logNotFound(boolean) ,public void logSubscribeFailed(java.lang.Exception, boolean) ,public void logSubscribeStarted(boolean) ,public void logUnsubscribeFailed(java.lang.Exception, boolean) ,public void logUnsubscribeStarted(boolean) ,public void logUpdatedEvent(boolean) ,public void logUpdatedSame(boolean) <variables>private com.nepxion.discovery.plugin.configcenter.logger.ConfigLogger configLogger,private com.nepxion.discovery.plugin.framework.adapter.PluginAdapter pluginAdapter,private com.nepxion.discovery.plugin.framework.event.PluginEventWapper pluginEventWapper