Examples

Talend ESB Mediation Developer Guide

EnrichVersion
6.2
EnrichProdName
Talend ESB
task
Installation and Upgrade
Design and Development
EnrichPlatform
Talend ESB

Triggering the Spring Batch job execution:

from("direct:startBatch").to("spring-batch:myJob");

Triggering the Spring Batch job execution with the JobLauncher set explicitly.

from("direct:startBatch").to("spring-batch:myJob?jobLauncherRef=myJobLauncher");

Starting from the Camel 2.11.1 JobExecution instance returned by the JobLauncher is forwarded by the SpringBatchProducer as the output message. You can use the JobExecution instance to perform some operations using the Spring Batch API directly.

from("direct:startBatch").to("spring-batch:myJob").to("mock:JobExecutions");
...
MockEndpoint mockEndpoint = ...;
JobExecution jobExecution = 
mockEndpoint.getExchanges().get(0).getIn().getBody(JobExecution.class);
BatchStatus currentJobStatus = jobExecution.getStatus();