Java Reference
In-Depth Information
Listing 11-30. geocodingJob Using Partitioning Configured in geocodeJob.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns=" http://www.springframework.org/schema/batch"
xmlns:beans=" http://www.springframework.org/schema/beans"
xmlns:int-jms=" http://www.springframework.org/schema/integration/jms"
xmlns:int=" http://www.springframework.org/schema/integration"
xmlns:jms=" http://www.springframework.org/schema/jms"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xmlns:task=" http://www.springframework.org/schema/task"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/integration/jms
http://www.springframework.org/schema/integration/jms/spring-integration-jms-2.0.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
http://www.springframework.org/schema/jms
http://www.springframework.org/schema/jms/spring-jms-3.0.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.0.xsd
http://www.springframework.org/schema/batch
http://www.springframework.org/schema/batch/spring-batch-2.1.xsd">
<beans:import resource="../launch-context.xml"/>
<job id="geocodingJob">
<step id="step1.master">
<partition partitioner="partitioner" handler="partitionHandler"/>
</step>
</job>
<beans:bean id="partitioner"
class="com.apress.springbatch.chapter11.partition.ColumnRangePartitioner">
<beans:property name="dataSource" ref="dataSource"/>
<beans:property name="column" value="id"/>
<beans:property name="table" value="customers"/>
<beans:property name="gridSize" value="3"/>
</beans:bean>
<step id="step1">
<tasklet>
<chunk reader="customerReader" processor="geocoder" writer="customerImportWriter"
commit-interval="1"/>
</tasklet>
</step>
<beans:bean id="customerReader"
class="org.springframework.batch.item.database.JdbcCursorItemReader" scope="step">
<beans:property name="dataSource" ref="dataSource"/>
<beans:property name="sql">
<beans:value><![CDATA[
Search WWH ::




Custom Search