| | |
| | | |
| | | private final FebsProperties properties; |
| | | |
| | | // 专门用于MVC异步处理的线程池 |
| | | @Bean("mvcTaskExecutor") |
| | | public ThreadPoolTaskExecutor mvcTaskExecutor() { |
| | | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); |
| | | executor.setCorePoolSize(10); |
| | | executor.setMaxPoolSize(50); |
| | | executor.setQueueCapacity(300); |
| | | executor.setThreadNamePrefix("mvc-async-"); |
| | | executor.setWaitForTasksToCompleteOnShutdown(true); |
| | | executor.setAwaitTerminationSeconds(60); |
| | | executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); |
| | | executor.initialize(); |
| | | return executor; |
| | | } |
| | | |
| | | @Bean(FebsConstant.ASYNC_POOL) |
| | | public ThreadPoolTaskExecutor asyncThreadPoolTaskExecutor(){ |
| | | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); |