diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/SnifferConfigInitializer.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/SnifferConfigInitializer.java
index b1c0a56c..ef811800 100644
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/SnifferConfigInitializer.java
+++ b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/SnifferConfigInitializer.java
@@ -17,8 +17,8 @@
package cn.hippo4j.agent.core.conf;
+import cn.hippo4j.agent.core.boot.AgentPackagePath;
import cn.hippo4j.common.boot.AgentPackageNotFoundException;
-import cn.hippo4j.common.boot.AgentPackagePath;
import cn.hippo4j.common.conf.Config;
import cn.hippo4j.common.conf.ConfigNotFoundException;
import cn.hippo4j.common.logging.api.ILog;
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/pom.xml b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/pom.xml
index dc3d87cf..40c0198a 100644
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/pom.xml
+++ b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/pom.xml
@@ -43,5 +43,10 @@
apollo-clientprovided
+
+ com.alibaba.nacos
+ nacos-client
+ 2.2.1
+
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v2/NacosDynamicThreadPoolChangeHandlerSpring2x.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v2/NacosDynamicThreadPoolChangeHandlerSpring2x.java
new file mode 100644
index 00000000..e13517ad
--- /dev/null
+++ b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v2/NacosDynamicThreadPoolChangeHandlerSpring2x.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 cn.hippo4j.agent.plugin.spring.boot.v2;
+
+import cn.hippo4j.agent.plugin.spring.common.conf.SpringBootConfig;
+import cn.hippo4j.common.executor.ThreadFactoryBuilder;
+import cn.hippo4j.common.logging.api.ILog;
+import cn.hippo4j.common.logging.api.LogManager;
+import cn.hippo4j.threadpool.dynamic.mode.config.parser.ConfigParserHandler;
+import cn.hippo4j.threadpool.dynamic.mode.config.properties.BootstrapConfigProperties;
+import cn.hippo4j.threadpool.dynamic.mode.config.refresher.AbstractConfigThreadPoolDynamicRefresh;
+import com.alibaba.nacos.api.NacosFactory;
+import com.alibaba.nacos.api.PropertyKeyConst;
+import com.alibaba.nacos.api.config.ConfigService;
+import com.alibaba.nacos.api.config.listener.Listener;
+import org.springframework.boot.context.properties.bind.Bindable;
+import org.springframework.boot.context.properties.bind.Binder;
+import org.springframework.boot.context.properties.source.ConfigurationPropertySource;
+import org.springframework.boot.context.properties.source.MapConfigurationPropertySource;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+
+import static cn.hippo4j.common.constant.Constants.DEFAULT_NAMESPACE_ID;
+
+/**
+ * NacosDynamicThreadPoolChangeHandlerSpring2x is responsible for handling dynamic thread pool
+ * configuration changes in a Spring environment by listening to configuration updates from Nacos.
+ *
+ * This class extends {@link AbstractConfigThreadPoolDynamicRefresh} and implements the logic
+ * to register a Nacos listener, handle configuration changes, and dynamically refresh the thread pool
+ * properties based on the new configuration.
+ *
+ * The handler is specifically tailored for use with Spring 2.x and integrates with Hippo4j's
+ * dynamic thread pool management system.
+ *
+ */
+public class NacosDynamicThreadPoolChangeHandlerSpring2x extends AbstractConfigThreadPoolDynamicRefresh {
+
+ private static final ILog LOGGER = LogManager.getLogger(NacosDynamicThreadPoolChangeHandlerSpring2x.class);
+
+ /**
+ * Registers a listener with Nacos to monitor for changes in the thread pool configuration.
+ *
+ * This method sets up the Nacos {@link ConfigService} with the server address and namespace
+ * from the Spring Boot configuration. It then adds a listener that will receive and process
+ * configuration updates, triggering a dynamic refresh of thread pool settings.
+ */
+ @Override
+ public void registerListener() {
+ // Retrieve necessary configuration properties
+ String configFileType = SpringBootConfig.Spring.Dynamic.Thread_Pool.CONFIG_FILE_TYPE;
+ String serverAddr = SpringBootConfig.Spring.Dynamic.Thread_Pool.Nacos.SERVER_ADDR;
+ String dataId = SpringBootConfig.Spring.Dynamic.Thread_Pool.Nacos.DATA_ID;
+ String namespace = SpringBootConfig.Spring.Dynamic.Thread_Pool.Nacos.NAMESPACE.get(0);
+ namespace = namespace.equals(DEFAULT_NAMESPACE_ID) ? "" : namespace;
+ String group = SpringBootConfig.Spring.Dynamic.Thread_Pool.Nacos.GROUP;
+ try {
+ // Initialize Nacos ConfigService with the provided properties
+ Properties properties = new Properties();
+ properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);
+ properties.put(PropertyKeyConst.NAMESPACE, namespace);
+ ConfigService configService = NacosFactory.createConfigService(properties);
+
+ // Define the listener to handle configuration changes
+ Listener configChangeListener = new Listener() {
+
+ @Override
+ public void receiveConfigInfo(String configInfo) {
+ LOGGER.debug("Received configuration: " + configInfo);
+ Map changeValueMap = new HashMap<>();
+ try {
+ // Parse the configuration and map the values to the appropriate keys
+ Map