【问题标题】:Spring batch split flow supported in the Grails plugin?Grails 插件支持 Spring 批处理拆分流?
【发布时间】:2013-08-09 09:48:12
【问题描述】:

我正在为 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')
  }
}

谢谢!

【问题讨论】:

    标签: spring grails spring-batch grails-plugin


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2016-09-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-16
      • 2012-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多