kongdeqiang
2024-07-05 3b787780c12b802d3cc5f6ff9983b2822a018c79
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
31
32
33
34
35
36
37
38
package com.boying;
 
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
 
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
 
/**
 * @author kdq
 * @version 1.0.0
 * @ClassName HkApplication.java
 * @Description TODO 参考网址: https://developer.aliyun.com/article/1199555
 * @createTime 2024年06月25日 09:37:00
 */
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableScheduling
public class HkApplication {
    public static void main(String[] args) {
        System.out.println("项目文件夹为:"+System.getProperty("user.dir"));
        SpringApplication.run(HkApplication.class, args);
    }
 
    //    //懒行为  创建对象并放到Spring容器中
    @Bean
    public ThreadPoolExecutor threadPoolExecutor() {
        return new ThreadPoolExecutor(10,
                20,
                60L,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(10));
    }
 
}