This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Batch Documentation 5.1.2!spring-doc.cn

This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Batch Documentation 5.1.2!spring-doc.cn

Item Readers

Table 1. Available Item Readers
Item Reader Description Thread-safe

AbstractItemStreamItemReaderspring-doc.cn

Abstract base class that combines the ItemStream and ItemReader interfaces.spring-doc.cn

Yesspring-doc.cn

AbstractItemCountingItemStreamItemReaderspring-doc.cn

Abstract base class that provides basic restart capabilities by counting the number of items returned from an ItemReader.spring-doc.cn

Nospring-doc.cn

AbstractPagingItemReaderspring-doc.cn

Abstract base class that provides basic paging featuresspring-doc.cn

Nospring-doc.cn

AbstractPaginatedDataItemReaderspring-doc.cn

Abstract base class that provides basic paging features based on Spring Data’s paginated facilitiesspring-doc.cn

Nospring-doc.cn

AggregateItemReaderspring-doc.cn

An ItemReader that delivers a list as its item, storing up objects from the injected ItemReader until they are ready to be packed out as a collection. This class must be used as a wrapper for a custom ItemReader that can identify the record boundaries. The custom reader should mark the beginning and end of records by returning an AggregateItem which responds true to its query methods (isHeader() and isFooter()). Note that this reader is not part of the library of readers provided by Spring Batch but given as a sample in spring-batch-samples.spring-doc.cn

Yesspring-doc.cn

AmqpItemReaderspring-doc.cn

Given a Spring AmqpTemplate, it provides synchronous receive methods. The receiveAndConvert() method lets you receive POJO objects.spring-doc.cn

Yesspring-doc.cn

KafkaItemReaderspring-doc.cn

An ItemReader that reads messages from an Apache Kafka topic. It can be configured to read messages from multiple partitions of the same topic. This reader stores message offsets in the execution context to support restart capabilities.spring-doc.cn

Nospring-doc.cn

FlatFileItemReaderspring-doc.cn

Reads from a flat file. Includes ItemStream and Skippable functionality. See “FlatFileItemReader”.spring-doc.cn

Nospring-doc.cn

ItemReaderAdapterspring-doc.cn

Adapts any class to the ItemReader interface.spring-doc.cn

Yesspring-doc.cn

JdbcCursorItemReaderspring-doc.cn

Reads from a database cursor over JDBC. See “Cursor-based ItemReaders”.spring-doc.cn

Nospring-doc.cn

JdbcPagingItemReaderspring-doc.cn

Given an SQL statement, pages through the rows, such that large datasets can be read without running out of memory.spring-doc.cn

Yesspring-doc.cn

JmsItemReaderspring-doc.cn

Given a Spring JmsOperations object and a JMS destination or destination name to which to send errors, provides items received through the injected JmsOperations#receive() method.spring-doc.cn

Yesspring-doc.cn

JpaCursorItemReaderspring-doc.cn

Executes a JPQL query and iterates over the returned result setspring-doc.cn

Nospring-doc.cn

JpaPagingItemReaderspring-doc.cn

Given a JPQL query, pages through the rows, such that large datasets can be read without running out of memory.spring-doc.cn

Yesspring-doc.cn

ListItemReaderspring-doc.cn

Provides the items from a list, one at a time.spring-doc.cn

Nospring-doc.cn

MongoItemReaderspring-doc.cn

Given a MongoOperations object and a JSON-based MongoDB query, provides items received from the MongoOperations#find() method.spring-doc.cn

Yesspring-doc.cn

Neo4jItemReaderspring-doc.cn

Given a Neo4jOperations object and the components of a Cyhper query, items are returned as the result of the Neo4jOperations.query method.spring-doc.cn

Yesspring-doc.cn

RepositoryItemReaderspring-doc.cn

Given a Spring Data PagingAndSortingRepository object, a Sort, and the name of method to execute, returns items provided by the Spring Data repository implementation.spring-doc.cn

Yesspring-doc.cn

StoredProcedureItemReaderspring-doc.cn

Reads from a database cursor resulting from the execution of a database stored procedure. See StoredProcedureItemReaderspring-doc.cn

Nospring-doc.cn

StaxEventItemReaderspring-doc.cn

Reads over StAX. see StaxEventItemReader.spring-doc.cn

Nospring-doc.cn

JsonItemReaderspring-doc.cn

Reads items from a Json document. see JsonItemReader.spring-doc.cn

Nospring-doc.cn

AvroItemReaderspring-doc.cn

Reads items from a resource containing serialized Avro objects.spring-doc.cn

Nospring-doc.cn

LdifReaderspring-doc.cn

Reads items from a LDIF resource and returns them as LdapAttributesspring-doc.cn

Nospring-doc.cn

MappingLdifReaderspring-doc.cn

Reads items from a LDIF resource and uses a RecordMapper to map them to domain objectsspring-doc.cn

Nospring-doc.cn

Table 1. Available Item Readers
Item Reader Description Thread-safe

AbstractItemStreamItemReaderspring-doc.cn

Abstract base class that combines the ItemStream and ItemReader interfaces.spring-doc.cn

Yesspring-doc.cn

AbstractItemCountingItemStreamItemReaderspring-doc.cn

Abstract base class that provides basic restart capabilities by counting the number of items returned from an ItemReader.spring-doc.cn

Nospring-doc.cn

AbstractPagingItemReaderspring-doc.cn

Abstract base class that provides basic paging featuresspring-doc.cn

Nospring-doc.cn

AbstractPaginatedDataItemReaderspring-doc.cn

Abstract base class that provides basic paging features based on Spring Data’s paginated facilitiesspring-doc.cn

Nospring-doc.cn

AggregateItemReaderspring-doc.cn

An ItemReader that delivers a list as its item, storing up objects from the injected ItemReader until they are ready to be packed out as a collection. This class must be used as a wrapper for a custom ItemReader that can identify the record boundaries. The custom reader should mark the beginning and end of records by returning an AggregateItem which responds true to its query methods (isHeader() and isFooter()). Note that this reader is not part of the library of readers provided by Spring Batch but given as a sample in spring-batch-samples.spring-doc.cn

Yesspring-doc.cn

AmqpItemReaderspring-doc.cn

Given a Spring AmqpTemplate, it provides synchronous receive methods. The receiveAndConvert() method lets you receive POJO objects.spring-doc.cn

Yesspring-doc.cn

KafkaItemReaderspring-doc.cn

An ItemReader that reads messages from an Apache Kafka topic. It can be configured to read messages from multiple partitions of the same topic. This reader stores message offsets in the execution context to support restart capabilities.spring-doc.cn

Nospring-doc.cn

FlatFileItemReaderspring-doc.cn

Reads from a flat file. Includes ItemStream and Skippable functionality. See “FlatFileItemReader”.spring-doc.cn

Nospring-doc.cn

ItemReaderAdapterspring-doc.cn

Adapts any class to the ItemReader interface.spring-doc.cn

Yesspring-doc.cn

JdbcCursorItemReaderspring-doc.cn

Reads from a database cursor over JDBC. See “Cursor-based ItemReaders”.spring-doc.cn

Nospring-doc.cn

JdbcPagingItemReaderspring-doc.cn

Given an SQL statement, pages through the rows, such that large datasets can be read without running out of memory.spring-doc.cn

Yesspring-doc.cn

JmsItemReaderspring-doc.cn

Given a Spring JmsOperations object and a JMS destination or destination name to which to send errors, provides items received through the injected JmsOperations#receive() method.spring-doc.cn

Yesspring-doc.cn

JpaCursorItemReaderspring-doc.cn

Executes a JPQL query and iterates over the returned result setspring-doc.cn

Nospring-doc.cn

JpaPagingItemReaderspring-doc.cn

Given a JPQL query, pages through the rows, such that large datasets can be read without running out of memory.spring-doc.cn

Yesspring-doc.cn

ListItemReaderspring-doc.cn

Provides the items from a list, one at a time.spring-doc.cn

Nospring-doc.cn

MongoItemReaderspring-doc.cn

Given a MongoOperations object and a JSON-based MongoDB query, provides items received from the MongoOperations#find() method.spring-doc.cn

Yesspring-doc.cn

Neo4jItemReaderspring-doc.cn

Given a Neo4jOperations object and the components of a Cyhper query, items are returned as the result of the Neo4jOperations.query method.spring-doc.cn

Yesspring-doc.cn

RepositoryItemReaderspring-doc.cn

Given a Spring Data PagingAndSortingRepository object, a Sort, and the name of method to execute, returns items provided by the Spring Data repository implementation.spring-doc.cn

Yesspring-doc.cn

StoredProcedureItemReaderspring-doc.cn

Reads from a database cursor resulting from the execution of a database stored procedure. See StoredProcedureItemReaderspring-doc.cn

Nospring-doc.cn

StaxEventItemReaderspring-doc.cn

Reads over StAX. see StaxEventItemReader.spring-doc.cn

Nospring-doc.cn

JsonItemReaderspring-doc.cn

Reads items from a Json document. see JsonItemReader.spring-doc.cn

Nospring-doc.cn

AvroItemReaderspring-doc.cn

Reads items from a resource containing serialized Avro objects.spring-doc.cn

Nospring-doc.cn

LdifReaderspring-doc.cn

Reads items from a LDIF resource and returns them as LdapAttributesspring-doc.cn

Nospring-doc.cn

MappingLdifReaderspring-doc.cn

Reads items from a LDIF resource and uses a RecordMapper to map them to domain objectsspring-doc.cn

Nospring-doc.cn

Item Writers

Table 2. Available Item Writers
Item Writer Description Thread-safe

AbstractItemStreamItemWriterspring-doc.cn

Abstract base class that combines the`ItemStream` and`ItemWriter` interfaces.spring-doc.cn

Yesspring-doc.cn

AmqpItemWriterspring-doc.cn

Given a Spring AmqpTemplate, provides for a synchronous send method. The convertAndSend(Object) method lets you send POJO objects.spring-doc.cn

Yesspring-doc.cn

CompositeItemWriterspring-doc.cn

Passes an item to the write method of each item in an injected List of ItemWriter objects.spring-doc.cn

Yesspring-doc.cn

FlatFileItemWriterspring-doc.cn

Writes to a flat file. Includes ItemStream and Skippable functionality. See “FlatFileItemWriter”.spring-doc.cn

Nospring-doc.cn

ItemWriterAdapterspring-doc.cn

Adapts any class to the ItemWriter interface.spring-doc.cn

Yesspring-doc.cn

JdbcBatchItemWriterspring-doc.cn

Uses batching features from a PreparedStatement, if available, and can take rudimentary steps to locate a failure during a flush.spring-doc.cn

Yesspring-doc.cn

JmsItemWriterspring-doc.cn

Using a JmsOperations object, items are written to the default queue through the JmsOperations#convertAndSend() method.spring-doc.cn

Yesspring-doc.cn

JpaItemWriterspring-doc.cn

This item writer is JPA EntityManager-aware and handles some transaction-related work that a non-“JPA-aware” ItemWriter would not need to know about and then delegates to another writer to do the actual writing.spring-doc.cn

Yesspring-doc.cn

KafkaItemWriterspring-doc.cn

Using a KafkaTemplate object, items are written to the default topic through the KafkaTemplate#sendDefault(Object, Object) method by using a Converter to map the key from the item. A delete flag can also be configured to send delete events to the topic.spring-doc.cn

Nospring-doc.cn

MimeMessageItemWriterspring-doc.cn

Using Spring’s JavaMailSender, items of type MimeMessage are sent as mail messages.spring-doc.cn

Yesspring-doc.cn

MongoItemWriterspring-doc.cn

Given a MongoOperations object, items are written through the MongoOperations.save(Object) method. The actual write is delayed until the last possible moment before the transaction commits.spring-doc.cn

Yesspring-doc.cn

Neo4jItemWriterspring-doc.cn

Given a Neo4jOperations object, items are persisted through the save(Object) method or deleted through the delete(Object), as dictated by the ItemWriter’s configurationspring-doc.cn

Yesspring-doc.cn

PropertyExtractingDelegatingItemWriterspring-doc.cn

Extends AbstractMethodInvokingDelegator creating arguments on the fly. Arguments are created by retrieving the values from the fields in the item to be processed (through a SpringBeanWrapper), based on an injected array of field names.spring-doc.cn

Yesspring-doc.cn

RepositoryItemWriterspring-doc.cn

Given a Spring Data CrudRepository implementation, items are saved through the method specified in the configuration.spring-doc.cn

Yesspring-doc.cn

StaxEventItemWriterspring-doc.cn

Uses a Marshaller implementation to convert each item to XML and then writes it to an XML file by using StAX.spring-doc.cn

Nospring-doc.cn

JsonFileItemWriterspring-doc.cn

Uses a JsonObjectMarshaller implementation to convert each item to Json and then writes it to a Json file.spring-doc.cn

Nospring-doc.cn

AvroItemWriterspring-doc.cn

Serializes data to an WritableResource using Avrospring-doc.cn

Nospring-doc.cn

ListItemWriterspring-doc.cn

Item writer that writes items to a List.spring-doc.cn

Nospring-doc.cn

Table 2. Available Item Writers
Item Writer Description Thread-safe

AbstractItemStreamItemWriterspring-doc.cn

Abstract base class that combines the`ItemStream` and`ItemWriter` interfaces.spring-doc.cn

Yesspring-doc.cn

AmqpItemWriterspring-doc.cn

Given a Spring AmqpTemplate, provides for a synchronous send method. The convertAndSend(Object) method lets you send POJO objects.spring-doc.cn

Yesspring-doc.cn

CompositeItemWriterspring-doc.cn

Passes an item to the write method of each item in an injected List of ItemWriter objects.spring-doc.cn

Yesspring-doc.cn

FlatFileItemWriterspring-doc.cn

Writes to a flat file. Includes ItemStream and Skippable functionality. See “FlatFileItemWriter”.spring-doc.cn

Nospring-doc.cn

ItemWriterAdapterspring-doc.cn

Adapts any class to the ItemWriter interface.spring-doc.cn

Yesspring-doc.cn

JdbcBatchItemWriterspring-doc.cn

Uses batching features from a PreparedStatement, if available, and can take rudimentary steps to locate a failure during a flush.spring-doc.cn

Yesspring-doc.cn

JmsItemWriterspring-doc.cn

Using a JmsOperations object, items are written to the default queue through the JmsOperations#convertAndSend() method.spring-doc.cn

Yesspring-doc.cn

JpaItemWriterspring-doc.cn

This item writer is JPA EntityManager-aware and handles some transaction-related work that a non-“JPA-aware” ItemWriter would not need to know about and then delegates to another writer to do the actual writing.spring-doc.cn

Yesspring-doc.cn

KafkaItemWriterspring-doc.cn

Using a KafkaTemplate object, items are written to the default topic through the KafkaTemplate#sendDefault(Object, Object) method by using a Converter to map the key from the item. A delete flag can also be configured to send delete events to the topic.spring-doc.cn

Nospring-doc.cn

MimeMessageItemWriterspring-doc.cn

Using Spring’s JavaMailSender, items of type MimeMessage are sent as mail messages.spring-doc.cn

Yesspring-doc.cn

MongoItemWriterspring-doc.cn

Given a MongoOperations object, items are written through the MongoOperations.save(Object) method. The actual write is delayed until the last possible moment before the transaction commits.spring-doc.cn

Yesspring-doc.cn

Neo4jItemWriterspring-doc.cn

Given a Neo4jOperations object, items are persisted through the save(Object) method or deleted through the delete(Object), as dictated by the ItemWriter’s configurationspring-doc.cn

Yesspring-doc.cn

PropertyExtractingDelegatingItemWriterspring-doc.cn

Extends AbstractMethodInvokingDelegator creating arguments on the fly. Arguments are created by retrieving the values from the fields in the item to be processed (through a SpringBeanWrapper), based on an injected array of field names.spring-doc.cn

Yesspring-doc.cn

RepositoryItemWriterspring-doc.cn

Given a Spring Data CrudRepository implementation, items are saved through the method specified in the configuration.spring-doc.cn

Yesspring-doc.cn

StaxEventItemWriterspring-doc.cn

Uses a Marshaller implementation to convert each item to XML and then writes it to an XML file by using StAX.spring-doc.cn

Nospring-doc.cn

JsonFileItemWriterspring-doc.cn

Uses a JsonObjectMarshaller implementation to convert each item to Json and then writes it to a Json file.spring-doc.cn

Nospring-doc.cn

AvroItemWriterspring-doc.cn

Serializes data to an WritableResource using Avrospring-doc.cn

Nospring-doc.cn

ListItemWriterspring-doc.cn

Item writer that writes items to a List.spring-doc.cn

Nospring-doc.cn