class RedisConfigAdapter extends ConfigAdapter {
    @Autowired
    private RedisOperation redisOperation;

    private MessageListenerAdapter partialMessageListenerAdapter;
    private MessageListenerAdapter globalMessageListenerAdapter;

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

    @PostConstruct
    @Override
    public void subscribeConfig() {
        String group = getGroup();

        logSubscribeStarted(false);

        try {
            partialMessageListenerAdapter = redisOperation.subscribeConfig(group, getDataId(false), this, "subscribePartialConfig");
        } catch (Exception e) {
            logSubscribeFailed(e, false);
        }

        logSubscribeStarted(true);

        try {
            globalMessageListenerAdapter = redisOperation.subscribeConfig(group, getDataId(true), this, "subscribeGlobalConfig");
        } catch (Exception e) {
            logSubscribeFailed(e, true);
        }
    }

    public void subscribePartialConfig(String config) {
        subscribeConfig(config, false);
    }

    public void subscribeGlobalConfig(String config) {
        subscribeConfig(config, true);
    }

    private void subscribeConfig(String config, boolean globalConfig) {
        redisOperation.subscribeConfig(config, new RedisSubscribeCallback() {
            @Override
            public void callback(String config) {
                callbackConfig(config, globalConfig);
            }
        });
    }

    @Override
    public void unsubscribeConfig() {
        unsubscribeConfig(partialMessageListenerAdapter, false);
        unsubscribeConfig(globalMessageListenerAdapter, true);
    }

    private void unsubscribeConfig(MessageListenerAdapter messageListenerAdapter, boolean globalConfig) {<FILL_FUNCTION_BODY>}

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

        if (messageListenerAdapter == null) {
            return;
        }

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

        logUnsubscribeStarted(globalConfig);

        try {
            redisOperation.unsubscribeConfig(group, dataId, messageListenerAdapter);
        } catch (Exception e) {
            logUnsubscribeFailed(e, globalConfig);
        }
    
<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