1、在启动类使用

@SpringBootApplication
@EnableJpaRepositories(repositoryFactoryBeanClass = MyRepositoryFactoryBean.class)
@EnableTransactionManagement
@EnableAutoConfiguration
//@EnableAutoConfiguration(exclude = {org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class})
@EnableScheduling
@Configuration
@EnableDiscoveryClient
@EnableFeignClients
@EnableCaching
public class Application extends DefaultApplication {
    
    /**
     *
     *〈简述〉修复同一时间无法执行多个 定时任务问题
     *〈详细描述〉
     * @author miaoShijun
     * @return
     */
    @Bean
    public TaskScheduler taskScheduler() {
        ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
        taskScheduler.setPoolSize(50);
        return taskScheduler;
    }
    
    /**
     * 〈简述〉应用启动入口
     * 〈详细描述〉
     *
     * @param args String[] 参数
     * @author miaoShijun
     */
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-05
  • 2022-03-09
  • 2022-12-23
  • 2021-12-10
猜你喜欢
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
相关资源
相似解决方案