package com.nq.config;
|
|
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Configuration;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
@Configuration
|
public class ThreadPoolConfig {
|
|
@Bean
|
public ThreadPoolTaskExecutor taskExecutor() {
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
executor.setCorePoolSize(4);
|
executor.setMaxPoolSize(4);
|
executor.setQueueCapacity(10);
|
executor.setThreadNamePrefix("stock-sync-");
|
executor.initialize();
|
return executor;
|
}
|
}
|