Skip to content

Commit 0de2db7

Browse files
committed
Added using virtual threads [#2429]
1 parent fc70392 commit 0de2db7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

comixed-batch/src/main/java/org/comixedproject/batch/BatchConfiguration.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ public class BatchConfiguration {
4949
*/
5050
@Bean(name = "jobTaskExecutor")
5151
public TaskExecutor jobTaskExecutor() {
52-
final SimpleAsyncTaskExecutor result = new SimpleAsyncTaskExecutor("CX-Jarvis");
53-
result.setConcurrencyLimit(this.batchThreadPoolSize);
54-
return result;
52+
return this.doCreateTaskExecutor("CX-Jarvis");
5553
}
5654

5755
/**
@@ -61,7 +59,14 @@ public TaskExecutor jobTaskExecutor() {
6159
*/
6260
@Bean(name = "stepTaskExecutor")
6361
public TaskExecutor stepTaskExecutor() {
64-
return new SimpleAsyncTaskExecutor("CX-Alfred");
62+
return this.doCreateTaskExecutor("CX-Jarvis");
63+
}
64+
65+
private SimpleAsyncTaskExecutor doCreateTaskExecutor(String name) {
66+
final SimpleAsyncTaskExecutor result = new SimpleAsyncTaskExecutor(name);
67+
result.setConcurrencyLimit(this.batchThreadPoolSize);
68+
result.setVirtualThreads(true);
69+
return result;
6570
}
6671

6772
/**

0 commit comments

Comments
 (0)