We are mixing spring-integration and the scheduling capabilities from spring-boot using:
@SpringBootApplication
@EnableIntegration
@IntegrationComponentScan
@EnableConfigurationProperties
@EnableScheduling
public class MyApplication {
...
}
@EnableScheduling creates a bean named "taskScheduler" which is then used by spring-integration:
public abstract class IntegrationContextUtils {
public static final String TASK_SCHEDULER_BEAN_NAME = "taskScheduler";
...
}
private void registerTaskScheduler() {
if (!this.beanFactory.containsBean(IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME)) {
...
this.registry.registerBeanDefinition(IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME, scheduler);
}
}
Problem is, the default poolSize for spring-integration is 10 (which value is needed as we encounter starvation) while the default for spring-boot is 1 (which we also need to avoid concurrency in our scheduled processes).
Questions:
- Is this a normal behavior for spring-integration to share his task scheduler bean with spring-boot scheduling capabilities?
- Is there a way to specify a unique task scheduler for spring-integration, whether scheduling in boot is enabled or not?
Thanks for your answers
spring.integration.taskScheduler.poolSizeis not used if @EnableScheduling is present - Christian German