Files
ruoyi-java/ruoyi-system/src/main/java/com/ruoyi/jarvis/config/GoofishAsyncConfig.java
2026-04-21 23:37:18 +08:00

24 lines
819 B
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.ruoyi.jarvis.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
@Configuration
public class GoofishAsyncConfig {
@Bean("goofishTaskExecutor")
public Executor goofishTaskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// 仅用于未配置 RocketMQ 时 HTTP 回调路径的 @Async过小易在拉单/回调并发时排队拖慢企微通知
executor.setCorePoolSize(4);
executor.setMaxPoolSize(16);
executor.setQueueCapacity(500);
executor.setThreadNamePrefix("goofish-");
executor.initialize();
return executor;
}
}