线程池提高百万级数据插入效率
application-dev.properties
添加线程池配置信息
# 异步线程配置
# 配置核心线程数
async.executor.thread.core_pool_size = 30
# 配置最大线程数
async.executor.thread.max_pool_size = 30
# 配置队列大小
async.executor.thread.queue_capacity = 99988
# 配置线程池中的线程的名称前缀
async.executor.thread.name.prefix = async-importDB-
spring容器注入线程池bean对象
@Configuration
@EnableAsync
@Slf4j
public class ExecutorConfig {
@Value("${async.ex