我使用 ClassifierCompositItemWriter 的以下作业配置文件在标题中说明错误。为什么找不到 BackToBackPatternClassifier?我对此真的很陌生。
我正在使用 - Spring-core version 3.2.2.RELEASE - Spring batch version 2.2.0.RELEASE
<bean id="domain" class="com.my.OneData" />
<job id="readAsString" xmlns="http://www.springframework.org/schema/batch">
<step id="step1">
<tasklet>
<chunk reader="theItemReader" writer="compositeWriter"
commit-interval="1" />
</tasklet>
</step>
</job>
<bean id="theItemReader" class="org.springframework.batch.item.file.FlatFileItemReader">
<property name="resource" value="file:csv/inputs/ad_usage_sample.csv" />
<property name="linesToSkip" value="1"></property>
<property name="lineMapper">
<bean
class="org.springframework.batch.item.file.mapping.PassThroughLineMapper">
</bean>
</property>
</bean>
<bean id="compositeWriter"
class="org.springframework.batch.item.support.ClassifierCompositeItemWriter">
<property name="classifier">
<bean
class="org.springframework.batch.classify.BackToBackPatternClassifier">
<property name="routerDelegate">
<bean class="com.my.LineClassifier" />
</property>
<property name="matcherMap">
<map>
<entry key="abc" value-ref="fileItemWriter1" />
<entry key="xyz" value-ref="fileItemWriter2" />
</map>
</property>
</bean>
</property>
</bean>
<bean id="fileItemWriter1" class="org.springframework.batch.item.file.FlatFileItemWriter">
<property name="resource" value="file:csv/outputs/oneLouderOutput3.csv" />
<property name="appendAllowed" value="true" />
<property name="lineAggregator">
<bean
class="org.springframework.batch.item.file.transform.DelimitedLineAggregator">
<property name="delimiter" value="," />
</bean>
</property>
</bean>
<bean id="fileItemWriter2" class="org.springframework.batch.item.file.FlatFileItemWriter">
<property name="resource" value="file:csv/outputs/oneLouderOutput3.csv" />
<property name="appendAllowed" value="true" />
<property name="lineAggregator">
<bean
class="org.springframework.batch.item.file.transform.DelimitedLineAggregator">
<property name="delimiter" value="," />
</bean>
</property>
</bean>