Could somebody help me rewrite this flow using a thread pool ? The below code works, but uses a fixed delay to service incoming files:
@Bean
public IntegrationFlow sampleFlow() {
return IntegrationFlows
.from(fileReadingMessageSource(), c -> c.poller(Pollers.fixedDelay(500)))
.channel(new DirectChannel())
.transform(fileMessageToJobRequest())
.handle(springBatchJobLauncher())
.handle(jobExecution -> {
logger.info("jobExecution payload: {}", jobExecution.getPayload());
})
.get();
}
Threads are needed because files are coming in a quick rate.