FINERACT-1724: Made inline loan COB reader and processor job scoped to avoid state sharing

This commit is contained in:
Arnold Galovics
2023-09-04 15:50:35 +02:00
committed by Arnold Gálovics
parent 0eb2a44ff3
commit c1ef701908
@@ -30,6 +30,7 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan;
import org.apache.fineract.portfolio.loanaccount.domain.LoanRepository;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.JobScope;
import org.springframework.batch.core.job.builder.JobBuilder;
import org.springframework.batch.core.launch.support.RunIdIncrementer;
import org.springframework.batch.core.listener.ExecutionContextPromotionListener;
@@ -96,11 +97,13 @@ public class LoanInlineCOBConfig {
.build();
}
@JobScope
@Bean
public InlineCOBLoanItemReader inlineCobWorkerItemReader() {
return new InlineCOBLoanItemReader(loanRepository);
}
@JobScope
@Bean
public InlineCOBLoanItemProcessor inlineCobWorkerItemProcessor() {
return new InlineCOBLoanItemProcessor(cobBusinessStepService);