class SchedulerConfig implements SchedulingConfigurer {

    @Override
    public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
        ThreadPoolTaskScheduler threadPool = new ThreadPoolTaskScheduler();
        threadPool.setPoolSize(poolSize);
        threadPool.setThreadNamePrefix("consent-scheduler-pool");
        threadPool.initialize();

        scheduledTaskRegistrar.setTaskScheduler(threadPool);
    }

}