Spring batch 弹簧批处理溶液

Spring batch 弹簧批处理溶液,spring-batch,batch-processing,spring-batch-tasklet,spring-batch-job-monitoring,spring-batch-stream,Spring Batch,Batch Processing,Spring Batch Tasklet,Spring Batch Job Monitoring,Spring Batch Stream,一, 在我们的应用程序中,我们有大约100000个客户,需要每月处理一些数据。每个客户的数据处理逻辑涉及到大约7个对不同服务的rest呼叫。我们需要在spring批处理中执行此操作以实现性能 处理数据的步骤-l 读取所有客户列表获取数据web服务-l 致电7个不同的微服务获取余额、类型、费用、日期等 将结果写入S3存储桶 请建议在spring批处理中设计流程您可以创建多个步骤的流程,其中每个步骤都可以发送serviceName作为参数。编写一个基于serviceName调用服务的customRe

一,

在我们的应用程序中,我们有大约100000个客户,需要每月处理一些数据。每个客户的数据处理逻辑涉及到大约7个对不同服务的rest呼叫。我们需要在spring批处理中执行此操作以实现性能

处理数据的步骤-l 读取所有客户列表获取数据web服务-l 致电7个不同的微服务获取余额、类型、费用、日期等 将结果写入S3存储桶


请建议在spring批处理中设计流程

您可以创建多个步骤的流程,其中每个步骤都可以发送serviceName作为参数。编写一个基于serviceName调用服务的customReader。在CustomReader中,您可以决定调用服务的方式

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)
}