Problem
The application uses @EnableScheduling on the main application class but does not configure a custom task scheduler. By default, Spring uses a single-threaded task scheduler. If one scheduled task blocks or takes a long time to run, it delays the execution of all other scheduled tasks.
Proposed Solution
Create a SchedulingConfig class that registers a ThreadPoolTaskScheduler bean with a configured pool size (e.g. 5–10 threads).
User Stories
- As a maintainer, I want scheduled tasks to run concurrently so that a delay in one task does not block other scheduled processes.
Acceptance Criteria
Tasks
Problem
The application uses
@EnableSchedulingon the main application class but does not configure a custom task scheduler. By default, Spring uses a single-threaded task scheduler. If one scheduled task blocks or takes a long time to run, it delays the execution of all other scheduled tasks.Proposed Solution
Create a
SchedulingConfigclass that registers aThreadPoolTaskSchedulerbean with a configured pool size (e.g. 5–10 threads).User Stories
Acceptance Criteria
SchedulingConfigis created.ThreadPoolTaskScheduleris configured.Tasks
SchedulingConfig.java.@EnableSchedulingfrom the main application class.