dromara / dromara/dynamic-tp

[BUG]: scheduled线程池类型配置自定义taskWrapperNames无效

Open
#581 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
4.8k
Forks
860
PR merge metrics
No merged PRs in 30d

Description

### 平台

Windows

### Jdk版本

JDK 21

### SpringBoot版本

2.7.18

### DynamicTp版本

1.2.2

### 配置中心类型

无配置中心

### 配置中心版本

### 问题描述

问题描述:断点调试ScheduledDtpExecutor的schedule方法,查看当前对象的taskWrappers属性是有自定义的TaskWrapper实例,但delegate的taskWrappers是空集合

**application.yaml配置文件:**

```
dynamicpt:
...
executors:
- threadPoolName: scheduledThreadPool
threadPoolAliasName: "spring定时任务线程池"
executorType: scheduled
taskWrapperNames: ["reqId"]
...

```

**spring Scheduling配置类:**
```
@Configuration
public class MyScheduledConfig implements SchedulingConfigurer {
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
ThreadPoolExecutor scheduledThreadPool = DtpRegistry.getDtpExecutor("scheduledThreadPool");
taskRegistrar.setScheduler(scheduledThreadPool);
}
}
```

### 复现步骤

1. jdk21 + springboot 2.7.18 + dynamictp 1.2.2

### 其他信息

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.