Tune thread pool sizes in a running Java service without redeploying or restarting anything
Get alerts on DingTalk or Slack when a thread pool is full or starts rejecting tasks
Monitor 20+ metrics about thread activity and queue depth exported to Prometheus dashboards
Gain visibility and control over internal pools inside Tomcat, Dubbo, RocketMQ, and gRPC
Four setup steps: add Maven/Gradle dependency, configure pool in your config center, annotate the startup class, inject the pool. Requires an existing config center like Nacos or Apollo.
DynamicTp is a Java library that solves a common headache with thread pools: you set the configuration at startup, it goes live, and then you discover the numbers were wrong. Changing them normally means editing code, redeploying, and restarting the service. DynamicTp lets you adjust thread pool settings while the application is running, without any downtime or redeployment. A thread pool, in this context, is how Java applications handle many tasks at once. You configure it with parameters like how many threads to keep active at minimum, how many to allow at peak, and how large the waiting queue can grow. Getting these numbers right matters for performance, but the right values often only become clear once the application is actually handling real traffic. DynamicTp stores these settings in a configuration center (it supports Nacos, Apollo, Zookeeper, Consul, Etcd, and others), so that pushing a change to the config center immediately updates the running thread pool with no restart needed. Beyond dynamic adjustment, the library adds monitoring and alerting. It collects over 20 metrics covering thread activity, queue depth, task throughput, and response time percentiles. These can be exported to Prometheus, logged as JSON, or queried via a Spring Boot endpoint. Alert rules let teams receive notifications when a thread pool hits capacity, starts rejecting tasks, or tasks begin taking too long. Alerts can be delivered via DingTalk, WeChat Work, Feishu, email, or a custom channel. The library also reaches into third-party components that manage their own internal thread pools, including Tomcat, Dubbo, RocketMQ, gRPC, RabbitMQ, and about a dozen others. Teams using those frameworks gain the same dynamic tuning and monitoring for pools they previously had no visibility into. Setup is described as four steps: add the dependency, configure the thread pool in the config center, annotate the application startup class, and inject the pool for use. Existing standard Java thread pools and Spring task executors can be brought under management by adding a single annotation.
← dromara on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.