I have the below code .Can I change the ThreadPoolExecutor thread number size at run time ? I am using spring boot.
@Configuration
public class ExecutorConfig
{
@Value(numberOfThreads)
private String numberOfThreads ; // numberOfThreads is configured app.properties file
@Bean
public ThreadPoolExecutor executorConfig()
{
ThreadPoolExecutor e = Executors.newFixedThreadPool(numberOfThreads);
return e;
}
}