新版仿ok交易所-后端
1
zj
2025-07-10 f15406ac788fb4e17a630c4d48129943af89fb9c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.yami.trading.admin.config;
 
import org.springframework.stereotype.Component;
 
 
@Component
public class ThreadPoolTaskExecutor extends org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor {
 
    private static final long serialVersionUID = 119645098645321188L;
 
    /**
     *     <property name="corePoolSize" value="4" />
     *         <property name="keepAliveSeconds" value="60" />
     *         <property name="maxPoolSize" value="20" />
     *         <property name="queueCapacity" value="0" />
     */
    public ThreadPoolTaskExecutor(){
        this.setCorePoolSize(4);
        this.setKeepAliveSeconds(60);
        this.setMaxPoolSize(20);
        this.setQueueCapacity(0);
        this.setRejectedExecutionHandler(new BalanceOffLineEventRejectExecutingHandler());
 
    }
 
    @Override
    public void execute(Runnable runnable) {
        super.execute(runnable);
    }
}