线程池使用 创建线程池 创建线程池 1.创建一个任务线程池 @Bean(name = "taskExecutor") public Executor taskExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(8); executor.setMaxPoolSize(20); executor.setQueueCapacity(50); executor.