|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import org.springframework.context.annotation.Bean; | 
|---|
|  |  |  | import org.springframework.context.annotation.Configuration; | 
|---|
|  |  |  | import org.springframework.core.annotation.Order; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.EnableAsync; | 
|---|
|  |  |  | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | * @author lin | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Configuration | 
|---|
|  |  |  | @Order(1) | 
|---|
|  |  |  | @EnableAsync(proxyTargetClass = true) | 
|---|
|  |  |  | public class ThreadPoolTaskConfig { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | * 允许线程空闲时间(单位:默认为秒) | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private static final int keepAliveTime = 30; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 缓冲队列大小 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private static final int queueCapacity = 500; | 
|---|
|  |  |  | private static final int queueCapacity = 10000; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 线程池名前缀 | 
|---|
|  |  |  | */ | 
|---|