Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Work in progress

...

Name

Default Value

Description

jobLauncherRef

null

Camel 2.10: Explicitly specifies the name of the JobLauncher to be used.

Usage examples

Triggering Spring Batch job execution:

Code Block
java
java

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

Triggering Spring Batch job execution with the JabLauncher set explicitly.

Code Block
java
java

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

Support classes

Apart from the Component, Camel Spring Batch provides also support classes to hook into Spring Batch infrastructure.

CamelItemReader

CamelItemReader can be used to read batch data directly from the Camel infrastructure.

For example the snippet below configures Spring Batch to read data from JMS queue.

Code Block
xml
xml

<bean id="camelReader" class="org.apache.camel.component.spring.batch.support.CamelItemReader">
  <constructor-arg ref="consumerTemplate"/>
  <constructor-arg value="jms:dataQueue"/>
</bean>

<batch:job id="myJob">
  <batch:step id="step">
    <batch:tasklet>
      <batch:chunk reader="camelReader" writer="someWriter" commit-interval="100"/>
    </batch:tasklet>
  </batch:step>
</batch:job>