|
@@ -21,6 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
+import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
|
|
+import org.springframework.core.task.TaskExecutor;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -81,9 +83,16 @@ public class JobConfiguration implements StepExecutionListener {
|
|
|
.skip(ServiceException.class)
|
|
|
.skipLimit(Integer.MAX_VALUE)
|
|
|
.listener(migrateJobSkipListener)
|
|
|
+ .taskExecutor(taskExecutor())
|
|
|
+ .throttleLimit(8)
|
|
|
.build();
|
|
|
}
|
|
|
|
|
|
+ @Bean
|
|
|
+ public TaskExecutor taskExecutor(){
|
|
|
+ return new SimpleAsyncTaskExecutor("spring_batch");
|
|
|
+ }
|
|
|
+
|
|
|
@Bean
|
|
|
@StepScope
|
|
|
public CommonFileItemReader<WaterMigrateFileItemDto> migrateFileItemItemReader() {
|
|
@@ -91,6 +100,7 @@ public class JobConfiguration implements StepExecutionListener {
|
|
|
return new CommonFileItemReader<>(WaterMigrateFileItemDto.class,filePath);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public void beforeStep(StepExecution stepExecution) {
|
|
|
parameterMap = stepExecution.getJobParameters().getParameters();
|