Spring-batch flow / split after a step

后端 未结 3 1686
花落未央
花落未央 2021-01-12 10:29

I am building a spring-batch solution that contains the following process:

step 1 : split a list into multiple lists step 2 : process each sub-list step 3 : merge

3条回答
  •  一向
    一向 (楼主)
    2021-01-12 10:41

    I've stumbled upon this question asking about how split works, and maybe this answer arrives a bit (one year) late, but here I go...

    The issue there is "split" is not a step by itself, but you were naming (and referencing) it as it was:

    
        
         
        
    
    

    The correct syntax would be:

    
        
        
             
                 
                 
            
             
                 
            
        
        
    
    

    But this is not what you want to achieve, because by split declarations you have to set in compile time the exact number of parallel steps that will be executed, and the purpose of split is using different steps in each flow instead calling several times the same one.

    You should check the documentation about Scaling and Parallel processes, the partition step seems a good candidate for your requirements.

提交回复
热议问题