One more fix

This commit is contained in:
James Agnew 2018-11-19 13:31:01 -05:00
parent 8da189334d
commit 45a5db6fd8
1 changed files with 6 additions and 7 deletions

View File

@ -55,7 +55,6 @@ import org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import javax.annotation.Nonnull;
import java.util.concurrent.ScheduledExecutorService;
@Configuration
@ -112,11 +111,11 @@ public abstract class BaseConfig implements SchedulingConfigurer {
}
@Bean()
public ScheduledExecutorService scheduledExecutorService() {
public ScheduledExecutorFactoryBean scheduledExecutorService() {
ScheduledExecutorFactoryBean b = new ScheduledExecutorFactoryBean();
b.setPoolSize(5);
b.afterPropertiesSet();
return b.getObject();
return b;
}
@Bean(name = "mySubscriptionTriggeringProvider")
@ -166,16 +165,16 @@ public abstract class BaseConfig implements SchedulingConfigurer {
@Bean()
public TaskScheduler taskScheduler() {
ConcurrentTaskScheduler retVal = new ConcurrentTaskScheduler();
retVal.setConcurrentExecutor(scheduledExecutorService());
retVal.setScheduledExecutor(scheduledExecutorService());
retVal.setConcurrentExecutor(scheduledExecutorService().getObject());
retVal.setScheduledExecutor(scheduledExecutorService().getObject());
return retVal;
}
@Bean(name = TASK_EXECUTOR_NAME)
public AsyncTaskExecutor taskExecutor() {
ConcurrentTaskScheduler retVal = new ConcurrentTaskScheduler();
retVal.setConcurrentExecutor(scheduledExecutorService());
retVal.setScheduledExecutor(scheduledExecutorService());
retVal.setConcurrentExecutor(scheduledExecutorService().getObject());
retVal.setScheduledExecutor(scheduledExecutorService().getObject());
return retVal;
}