org.springframework.batch.item.ItemStreamReader Java Examples

The following examples show how to use org.springframework.batch.item.ItemStreamReader. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BatchConfiguration.java    From spring-graalvm-native with Apache License 2.0 5 votes vote down vote up
@Bean
@StepScope
public ItemStreamReader<CustomerCredit> itemReader() {
	return new FlatFileItemReaderBuilder<CustomerCredit>()
			.name("itemReader")
			.resource(new ClassPathResource("/customer.csv"))
			.delimited()
			.names("name", "credit")
			.targetType(CustomerCredit.class)
			.build();
}
 
Example #2
Source File: AddressMigrationJobConfiguration.java    From spring-batch-lightmin with Apache License 2.0 5 votes vote down vote up
@Bean
public Step addressMigrationStep(final StepBuilderFactory stepBuilderFactory,
                                 final ItemStreamReader<BatchTaskAddress> addressReader,
                                 final ItemProcessor<BatchTaskAddress, BatchTaskAddress> addressMigrationProcessor,
                                 final ItemWriter<BatchTaskAddress> addressWriter) throws Exception {
    return stepBuilderFactory.get("addressMigrationStep")
            .<BatchTaskAddress, BatchTaskAddress>chunk(1)
            .reader(addressReader)
            .processor(addressMigrationProcessor)
            .writer(addressWriter)
            .build();
}
 
Example #3
Source File: AddressPrinterJobConfiguration.java    From spring-batch-lightmin with Apache License 2.0 5 votes vote down vote up
@Bean
public Step addressPrinterStep(final StepBuilderFactory stepBuilderFactory,
                               final ItemStreamReader<Long> addressPrinterReader,
                               final ItemProcessor<Long, Address> addressPrinterProcessor,
                               final ItemWriter<Address> addressPrinterWriter) throws Exception {
    return stepBuilderFactory
            .get("addressPrinterStep")
            .<Long, Address>chunk(1)
            .reader(addressPrinterReader)
            .processor(addressPrinterProcessor)
            .writer(addressPrinterWriter)
            .allowStartIfComplete(Boolean.TRUE)
            .build();
}
 
Example #4
Source File: AddressPrinterJobConfiguration.java    From spring-batch-lightmin with Apache License 2.0 5 votes vote down vote up
@Bean
public Step addressBatchTaskDeletionStep(final StepBuilderFactory stepBuilderFactory,
                                         final ItemStreamReader<Long> addressBatchTaskDeletionReader,
                                         final ItemWriter<Long> addressBatchTaskDeletionWriter) throws Exception {
    return stepBuilderFactory
            .get("addressBatchTaskDeletionStep")
            .<Long, Long>chunk(1)
            .reader(addressBatchTaskDeletionReader)
            .writer(addressBatchTaskDeletionWriter)
            .allowStartIfComplete(Boolean.TRUE)
            .build();
}
 
Example #5
Source File: MetricsTestItemReader.java    From spring-boot-starter-batch-web with Apache License 2.0 4 votes vote down vote up
public MetricsTestItemReader(ItemStreamReader<Item> delegate, BatchMetrics businessMetrics,
		boolean readerTransactional) {
	this.delegate = delegate;
	this.businessMetrics = businessMetrics;
	this.readerTransactional = readerTransactional;
}