繁体   English   中英

Grails插件支持Spring批处理拆分流吗?

[英]Spring batch split flow supported in the Grails plugin?

我正在使用Grails的Spring批处理插件(spring-batch-1.0.RC2)。 到目前为止,一切正常,但是我想拆分流程以执行...是否支持? 这是我要执行的代码...但是结果是Step1,Step2,Step3,Step 4。

beans {
  xmlns batch:"http://www.springframework.org/schema/batch"

  jobLauncher(org.springframework.batch.core.launch.support.SimpleJobLauncher){
     jobRepository = ref("jobRepository")
     taskExecutor = bean(org.springframework.core.task.SimpleAsyncTaskExecutor)
     taskExecutorParallel = bean(org.springframework.core.task.SimpleAsyncTaskExecutor)
  }

  batch.job(id: 'endOfDayJob') {
     batch.step(id: 'logStart', next:'createContext') {
        batch.tasklet(ref: 'printStartMessage')
     }

  batch.step(id: 'createContext', next:'split1') {
    batch.tasklet(ref: 'context')
  }

  batch.split(id: 'split1',taskexecutor:'taskExecutorParallel', next:'logFinish'  ) {
    batch.flow{ 

       batch.step(id:'step1Id', next:'step2Id'){
            batch.tasklet(ref: 'step1')
        }           
        batch.step(id: 'step2Id') {
            batch.tasklet(ref: 'step2')
        }
    }
    batch.flow{
        batch.step(id:'step3Id', next:'step4Id'){
            batch.tasklet(ref: 'step3')
        } 
        batch.step(id: 'step4Id') {
            batch.tasklet(ref: 'step4')
        }
    }
  }

  batch.step(id: 'logFinish') {
    batch.tasklet(ref: 'printEndMessage')
  }
}

谢谢!

我明白了...得到了支持...我在这行中有一个错误:

batch.split(id: 'split1','task-executor':'taskExecutorParallel', next:'logFinish'  ) {

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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