@Configuration
@EnableConfigurationProperties(MyThreadProperties.class)
public class MyThreadAutoConfiguration {

@Bean
public ThreadPoolExecutor threadPoolExecutor(MyThreadProperties myThreadProperties){
return new ThreadPoolExecutor(myThreadProperties.getCoreSize(),myThreadProperties.getMaxSize(),myThreadProperties.getKeepLiveTime(), TimeUnit.SECONDS,new LinkedBlockingDeque<>(),
new ThreadPoolExecutor.AbortPolicy());
}

}