getRequestArgs() {
+ return requestArgs;
+ }
+}
diff --git a/plugin/config/src/main/java/com/alibaba/nacos/plugin/config/model/ConfigChangeResponse.java b/plugin/config/src/main/java/com/alibaba/nacos/plugin/config/model/ConfigChangeResponse.java
new file mode 100644
index 000000000..42c0f9af7
--- /dev/null
+++ b/plugin/config/src/main/java/com/alibaba/nacos/plugin/config/model/ConfigChangeResponse.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 1999-2018 Alibaba Group Holding Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.alibaba.nacos.plugin.config.model;
+
+import com.alibaba.nacos.plugin.config.constants.ConfigChangePointCutTypes;
+
+/**
+ * ConfigChangeResponse.
+ *
+ * @author liyunfei
+ */
+public class ConfigChangeResponse {
+
+ private ConfigChangePointCutTypes responseType;
+
+ private boolean isSuccess;
+
+ private Object retVal;
+
+ private String msg;
+
+ public ConfigChangeResponse(ConfigChangePointCutTypes responseType) {
+ this.responseType = responseType;
+ }
+
+ public ConfigChangePointCutTypes getResponseType() {
+ return responseType;
+ }
+
+ public void setResponseType(ConfigChangePointCutTypes responseType) {
+ this.responseType = responseType;
+ }
+
+ public boolean isSuccess() {
+ return isSuccess;
+ }
+
+ public void setSuccess(boolean success) {
+ isSuccess = success;
+ }
+
+ public Object getRetVal() {
+ return retVal;
+ }
+
+ public void setRetVal(Object retVal) {
+ this.retVal = retVal;
+ }
+
+ public String getMsg() {
+ return msg;
+ }
+
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+
+}
diff --git a/plugin/config/src/main/java/com/alibaba/nacos/plugin/config/spi/ConfigChangePluginService.java b/plugin/config/src/main/java/com/alibaba/nacos/plugin/config/spi/ConfigChangePluginService.java
new file mode 100644
index 000000000..bb9afdb94
--- /dev/null
+++ b/plugin/config/src/main/java/com/alibaba/nacos/plugin/config/spi/ConfigChangePluginService.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 1999-2022 Alibaba Group Holding Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.alibaba.nacos.plugin.config.spi;
+
+import com.alibaba.nacos.plugin.config.constants.ConfigChangeConstants;
+import com.alibaba.nacos.plugin.config.constants.ConfigChangeExecuteTypes;
+import com.alibaba.nacos.plugin.config.constants.ConfigChangePointCutTypes;
+import com.alibaba.nacos.plugin.config.model.ConfigChangeRequest;
+import com.alibaba.nacos.plugin.config.model.ConfigChangeResponse;
+
+/**
+ * ConfigChangePluginService.
+ *
+ * @author liyunfei
+ */
+public interface ConfigChangePluginService {
+
+ /**
+ * execute config change plugin service.
+ *
+ * @param configChangeRequest ConfigChangeRequest
+ * @param configChangeResponse ConfigChangeResponse
+ */
+ void execute(ConfigChangeRequest configChangeRequest, ConfigChangeResponse configChangeResponse);
+
+ /**
+ * execute type {@link ConfigChangeExecuteTypes}.
+ *
+ * @return type
+ */
+ ConfigChangeExecuteTypes executeType();
+
+
+ /**
+ * what kind of plugin service,such as webhook,whiteList and other,need keep a way with the constants config of you
+ * enum in {@link ConfigChangeConstants}.
+ *
+ * @return service type
+ */
+ String getServiceType();
+
+ /**
+ * when pointcut the same method,according to order to load plugin service. order is lower,prior is higher.
+ *
+ * @return order
+ */
+ int getOrder();
+
+ /**
+ * the ConfigChangeTypes {@link ConfigChangePointCutTypes} of need to pointcut.
+ *
+ *
+ * ConfigChangeTypes mean the relevant pointcut method.
+ *
+ *
+ * @return array of pointcut the methods
+ */
+ default ConfigChangePointCutTypes[] pointcutMethodNames() {
+ return ConfigChangeConstants.getPointcuts(getServiceType());
+ }
+
+}
diff --git a/plugin/config/src/test/java/com/alibaba/nacos/plugin/config/ConfigChangePluginManagerTests.java b/plugin/config/src/test/java/com/alibaba/nacos/plugin/config/ConfigChangePluginManagerTests.java
new file mode 100644
index 000000000..12c39da45
--- /dev/null
+++ b/plugin/config/src/test/java/com/alibaba/nacos/plugin/config/ConfigChangePluginManagerTests.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright 1999-2022 Alibaba Group Holding Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.alibaba.nacos.plugin.config;
+
+import com.alibaba.nacos.plugin.config.constants.ConfigChangeExecuteTypes;
+import com.alibaba.nacos.plugin.config.constants.ConfigChangePointCutTypes;
+import com.alibaba.nacos.plugin.config.model.ConfigChangeRequest;
+import com.alibaba.nacos.plugin.config.model.ConfigChangeResponse;
+import com.alibaba.nacos.plugin.config.spi.ConfigChangePluginService;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Optional;
+import java.util.PriorityQueue;
+
+/**
+ * ConfigChangePluginManagerTests.
+ *
+ * @author liyunfei
+ **/
+public class ConfigChangePluginManagerTests {
+ @Test
+ public void testInstance() {
+ ConfigChangePluginManager instance = ConfigChangePluginManager.getInstance();
+ Assert.assertNotNull(instance);
+ }
+
+ @Before
+ public void initPluginServices() {
+ ConfigChangePluginManager.join(new ConfigChangePluginService() {
+ @Override
+ public void execute(ConfigChangeRequest configChangeRequest, ConfigChangeResponse configChangeResponse) {
+ // ignore
+ }
+
+ @Override
+ public ConfigChangeExecuteTypes executeType() {
+ return ConfigChangeExecuteTypes.EXECUTE_BEFORE_TYPE;
+ }
+
+ @Override
+ public String getServiceType() {
+ return "test1";
+ }
+
+ @Override
+ public int getOrder() {
+ return 0;
+ }
+
+ @Override
+ public ConfigChangePointCutTypes[] pointcutMethodNames() {
+ return new ConfigChangePointCutTypes[]{ConfigChangePointCutTypes.PUBLISH_BY_HTTP, ConfigChangePointCutTypes.PUBLISH_BY_RPC};
+ }
+ });
+ ConfigChangePluginManager.join(new ConfigChangePluginService() {
+ @Override
+ public void execute(ConfigChangeRequest configChangeRequest, ConfigChangeResponse configChangeResponse) {
+ // ignore
+ }
+
+ @Override
+ public ConfigChangeExecuteTypes executeType() {
+ return ConfigChangeExecuteTypes.EXECUTE_BEFORE_TYPE;
+ }
+
+ @Override
+ public String getServiceType() {
+ return "test2";
+ }
+
+ @Override
+ public int getOrder() {
+ return 200;
+ }
+
+ @Override
+ public ConfigChangePointCutTypes[] pointcutMethodNames() {
+ return new ConfigChangePointCutTypes[]{ConfigChangePointCutTypes.IMPORT_BY_HTTP, ConfigChangePointCutTypes.PUBLISH_BY_RPC};
+ }
+ });
+ }
+
+ @Test
+ public void testFindPluginServiceQueueByPointcut() {
+ PriorityQueue configChangePluginServicePriorityQueue = ConfigChangePluginManager
+ .findPluginServiceQueueByPointcut(ConfigChangePointCutTypes.PUBLISH_BY_HTTP);
+ Assert.assertEquals(1, configChangePluginServicePriorityQueue.size());
+ configChangePluginServicePriorityQueue = ConfigChangePluginManager
+ .findPluginServiceQueueByPointcut(ConfigChangePointCutTypes.PUBLISH_BY_RPC);
+ Assert.assertEquals(2, configChangePluginServicePriorityQueue.size());
+ configChangePluginServicePriorityQueue = ConfigChangePluginManager
+ .findPluginServiceQueueByPointcut(ConfigChangePointCutTypes.IMPORT_BY_HTTP);
+ Assert.assertEquals(1, configChangePluginServicePriorityQueue.size());
+ configChangePluginServicePriorityQueue = ConfigChangePluginManager
+ .findPluginServiceQueueByPointcut(ConfigChangePointCutTypes.REMOVE_BATCH_HTTP);
+ Assert.assertEquals(0, configChangePluginServicePriorityQueue.size());
+ configChangePluginServicePriorityQueue = ConfigChangePluginManager
+ .findPluginServiceQueueByPointcut(ConfigChangePointCutTypes.REMOVE_BY_RPC);
+ Assert.assertEquals(0, configChangePluginServicePriorityQueue.size());
+ configChangePluginServicePriorityQueue = ConfigChangePluginManager
+ .findPluginServiceQueueByPointcut(ConfigChangePointCutTypes.REMOVE_BY_HTTP);
+ Assert.assertEquals(0, configChangePluginServicePriorityQueue.size());
+ }
+
+ @Test
+ public void testFindPluginServiceByServiceType() {
+ Optional configChangePluginServiceOptional = ConfigChangePluginManager
+ .getInstance().findPluginServiceImpl("test1");
+ Assert.assertTrue(configChangePluginServiceOptional.isPresent());
+ configChangePluginServiceOptional = ConfigChangePluginManager.getInstance().findPluginServiceImpl("test2");
+ Assert.assertTrue(configChangePluginServiceOptional.isPresent());
+ configChangePluginServiceOptional = ConfigChangePluginManager.getInstance().findPluginServiceImpl("test3");
+ Assert.assertFalse(configChangePluginServiceOptional.isPresent());
+ }
+}
diff --git a/plugin/pom.xml b/plugin/pom.xml
index 3852ad1c4..f98f224f7 100644
--- a/plugin/pom.xml
+++ b/plugin/pom.xml
@@ -36,6 +36,7 @@
datasource
environment
control
+ config
pom
diff --git a/pom.xml b/pom.xml
index 9c4368994..eec4aa06e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -720,6 +720,11 @@
nacos-encryption-plugin
${project.version}