@@ -25,12 +25,22 @@ public class ThreadConfig extends AsyncConfigurerSupport implements SchedulingCo
2525
2626 @ Bean
2727 public Executor executor () {
28- return makeExecutor ();
28+ ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor ();
29+ threadPoolTaskExecutor .setCorePoolSize (1 );
30+ threadPoolTaskExecutor .setMaxPoolSize (1 );
31+ threadPoolTaskExecutor .initialize ();
32+
33+ return new LazyTraceExecutor (beanFactory , threadPoolTaskExecutor );
2934 }
3035
3136 @ Override
3237 public Executor getAsyncExecutor () {
33- return makeExecutor ();
38+ ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor ();
39+ threadPoolTaskExecutor .setCorePoolSize (1 );
40+ threadPoolTaskExecutor .setMaxPoolSize (1 );
41+ threadPoolTaskExecutor .initialize ();
42+
43+ return new LazyTraceExecutor (beanFactory , threadPoolTaskExecutor );
3444 }
3545
3646 @ Override
@@ -40,17 +50,6 @@ public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
4050
4151 @ Bean (destroyMethod = "shutdown" )
4252 public Executor schedulingExecutor () {
43- return Executors .newScheduledThreadPool (100 );
53+ return Executors .newScheduledThreadPool (1 );
4454 }
45-
46- private Executor makeExecutor () {
47- ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor ();
48- threadPoolTaskExecutor .setCorePoolSize (5 );
49- threadPoolTaskExecutor .setMaxPoolSize (10 );
50- threadPoolTaskExecutor .initialize ();
51-
52- return new LazyTraceExecutor (beanFactory , threadPoolTaskExecutor );
53- }
54-
55-
5655}
0 commit comments