...
Name | Default Value | Description |
---|---|---|
| | Camel 2.10: Explicitly specifies the name of the |
Usage examples
Triggering Spring Batch job execution:
Code Block | ||||
---|---|---|---|---|
| ||||
from("direct:startBatch").to("spring-batch:myJob");
|
Triggering Spring Batch job execution with the JabLauncher
set explicitly.
Code Block | ||||
---|---|---|---|---|
| ||||
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 | ||||
---|---|---|---|---|
| ||||
<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>
|