Spring Boot comes with a single thread for TaskScheduler
by default: https://docs.spring.io/spring-boot/reference/features/task-execution-and-scheduling.html.
You may consider to increase its pool:
spring.task.scheduling.pool.size=10
Also, it is strange to see preventDuplicates(false)
. That means that the same file might be picked up by the next polling cycle. I understand that you delete those files, but that still might be an issue.
Any chances that you can share with us a simple project to reproduce on our side?