api-修改线程池内容
This commit is contained in:
@@ -25,7 +25,6 @@ public class NettyWeiXinApplication {
|
||||
* @param args 启动参数
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// SpringApplication.run(NettyWeiXinApplication.class, args);
|
||||
ConfigurableApplicationContext context = SpringApplication.run(NettyWeiXinApplication.class, args);
|
||||
SpringContextHolder.setContext(context);
|
||||
//启动netty
|
||||
@@ -33,33 +32,4 @@ public class NettyWeiXinApplication {
|
||||
bootService.run();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 项目可能又使用计划任务的
|
||||
*/
|
||||
// private int corePoolSize = 5;//线程池维护线程的最少数量
|
||||
//
|
||||
// private int maxPoolSize = 15;//线程池维护线程的最大数量
|
||||
//
|
||||
// private int queueCapacity = 5; //缓存队列
|
||||
//
|
||||
// private int keepAlive = 60;//允许的空闲时间
|
||||
// @Bean("scheduledExecutorService")
|
||||
// public ScheduledExecutorService initScheduledExecutorService() {
|
||||
// ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(400,
|
||||
// new BasicThreadFactory.Builder().namingPattern("example-schedule-pool-%d").daemon(true).build());
|
||||
// return executorService;
|
||||
// }
|
||||
// @Bean
|
||||
// public Executor executor() {
|
||||
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
// executor.setCorePoolSize(corePoolSize);
|
||||
// executor.setMaxPoolSize(maxPoolSize);
|
||||
// executor.setQueueCapacity(queueCapacity);
|
||||
// executor.setThreadNamePrefix("mqExecutor-");
|
||||
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardOldestPolicy());
|
||||
// executor.setKeepAliveSeconds(keepAlive);
|
||||
// executor.initialize();
|
||||
// return executor;
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user