feat:
1. notice module
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package org.springblade.common.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@Configuration
|
||||
@EnableAsync
|
||||
public class AsyncConfiguration {
|
||||
|
||||
|
||||
// 通知类:短信、邮件、站内信
|
||||
@Bean("notificationExecutor")
|
||||
public ThreadPoolTaskExecutor notificationExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(6);
|
||||
executor.setMaxPoolSize(12);
|
||||
executor.setQueueCapacity(200);
|
||||
executor.setThreadNamePrefix("notify-");
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user