One more fix
This commit is contained in:
parent
8da189334d
commit
45a5db6fd8
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue