简体   繁体   中英

Spring Batch Solution

1

In our application, we have around 100000 customers and need to process some data on monthly basis. Data processing logic for each customer involves, around 7 rest calls to different service. We need to do this in spring batch to achieve performance.

Steps to process data --l Read all customers List-get the data web service--l call 7 different micro services to get the balance, type, fees, date etc etc..--l Write result to S3 bucket

please suggest the design the flow in spring batch

you can create a flow of multiple steps where for each step you can send "serviceName" as parameter. Write a customReader which calls the service based on serviceName. In CustomReader you can decide on the way you want to call the services.

List<Step> steps = new ArrayList<>();
for(each of your service){
 createStep(String serviceName);
}

private Step createStep(String serviceName){
return stepBuilderFactory.get(""service calls")
.reader(UorCustomReader)
.processor(YourProcessor)//if needed
.writer(YourCustomCompositeWriter)
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM