I have defined a job with custom item reader, writer and processor. It doesn't do much, just dummy things, but it enters an infinite loop. In the log I see that after an item writer finishes the execution, the item reader is directly called; in other words the steps repeats again and again and never finishes. I cannot figure out what should be done in order to make a step complete.
These are job configurations:
Reader, Processor, Writer:Code:<batch:job id="myJob" > <batch:step id="myStep" > <batch:tasklet > <batch:chunk reader="myReader" processor="myProcessor" writer="myWriter" commit-interval="1" /> </batch:tasklet </batch:step> </batch:job> <bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher"> <property name="jobRepository" ref="jobRepository"/> </bean> <bean id="transactionManager" class="org.springframework.batch.support.transaction.ResourcelessTransactionManager"/> <bean id="jobRepository" class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean"> <property name="transactionManager" ref="transactionManager"/> <property name="isolationLevelForCreate" value="ISOLATION_DEFAULT"/> </bean>
ThnxCode:public class DummyReader implements ItemReader < String > { public String read ( ) { return "dummy"; } } public class DummyProcessor implements ItemProcessor < String, String> { public String process ( String item ) throws Exception { //do nothing return item; } } public class DummyWriter implements ItemWriter < String > { public void write ( List < ? extends String > items ) throws Exception { //do nothing } }


Reply With Quote