2 changed files with 30 additions and 2 deletions
@ -0,0 +1,22 @@ |
|||||
|
package com.kms.web.config; |
||||
|
|
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
|
||||
|
import java.util.concurrent.LinkedBlockingQueue; |
||||
|
import java.util.concurrent.ThreadPoolExecutor; |
||||
|
import java.util.concurrent.TimeUnit; |
||||
|
|
||||
|
@Configuration |
||||
|
public class CommonThreadPoolConfig { |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 线程池定义 |
||||
|
*/ |
||||
|
@Bean() |
||||
|
public ThreadPoolExecutor commonPool() { |
||||
|
return new ThreadPoolExecutor(30, 50, 200, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1000)); |
||||
|
} |
||||
|
|
||||
|
} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue