## Appendix A: List of ItemReaders and ItemWriters

### Item Readers

|              Item Reader               |                                                                                                                                                                                                                                                                                                   Description                                                                                                                                                                                                                                                                                                   |
|----------------------------------------| |
|AbstractItemCountingItemStreamItemReader|                                                                                                                                                                                                                                       Abstract base class that provides basic<br/>restart capabilities by counting the number of items returned from<br/>an `ItemReader`.                                                                                                                                                                                                                                       |
|          AggregateItemReader           |An `ItemReader` that delivers a list as its<br/>item, storing up objects from the injected `ItemReader` until they<br/>are ready to be packed out as a collection. This class must be used<br/>as a wrapper for a custom `ItemReader` that can identify the record<br/>boundaries. The custom reader should mark the beginning and end of<br/>records by returning an `AggregateItem` which responds `true` to its<br/>query methods `isHeader()` and `isFooter()`. Note that this reader<br/>is not part of the library of readers provided by Spring Batch<br/>but given as a sample in `spring-batch-samples`.|
|             AmqpItemReader             |                                                                                                                                                                                                                                 Given a Spring `AmqpTemplate`, it provides<br/>synchronous receive methods. The `receiveAndConvert()` method<br/>lets you receive POJO objects.                                                                                                                                                                                                                                 |
|            KafkaItemReader             |                                                                                                                                                                             An `ItemReader` that reads messages from an Apache Kafka topic.<br/>It can be configured to read messages from multiple partitions of the same topic.<br/>This reader stores message offsets in the execution context to support restart capabilities.                                                                                                                                                                              |
|           FlatFileItemReader           |                                                                                                                                                                                                                               Reads from a flat file. Includes `ItemStream`and `Skippable` functionality. See [`FlatFileItemReader`](readersAndWriters.html#flatFileItemReader).                                                                                                                                                                                                                                |
|       HibernateCursorItemReader        |                                                                                                                                                                                                                                           Reads from a cursor based on an HQL query. See[`Cursor-based ItemReaders`](readersAndWriters.html#cursorBasedItemReaders).                                                                                                                                                                                                                                            |
|       HibernatePagingItemReader        |                                                                                                                                                                                                                                                                                        Reads from a paginated HQL query                                                                                                                                                                                                                                                                                         |
|           ItemReaderAdapter            |                                                                                                                                                                                                                                                                                 Adapts any class to the`ItemReader` interface.                                                                                                                                                                                                                                                                                  |
|          JdbcCursorItemReader          |                                                                                                                                                                                                                                             Reads from a database cursor via JDBC. See[`Cursor-based ItemReaders`](readersAndWriters.html#cursorBasedItemReaders).                                                                                                                                                                                                                                              |
|          JdbcPagingItemReader          |                                                                                                                                                                                                                                           Given an SQL statement, pages through the rows,<br/>such that large datasets can be read without running out of<br/>memory.                                                                                                                                                                                                                                           |
|             JmsItemReader              |                                                                                                                                                                                                         Given a Spring `JmsOperations` object and a JMS<br/>Destination or destination name to which to send errors, provides items<br/>received through the injected `JmsOperations#receive()`method.                                                                                                                                                                                                          |
|          JpaPagingItemReader           |                                                                                                                                                                                                                                           Given a JPQL statement, pages through the<br/>rows, such that large datasets can be read without running out of<br/>memory.                                                                                                                                                                                                                                           |
|             ListItemReader             |                                                                                                                                                                                                                                                                               Provides the items from a list, one at a<br/>time.                                                                                                                                                                                                                                                                                |
|            MongoItemReader             |                                                                                                                                                                                                                                     Given a `MongoOperations` object and a JSON-based MongoDB<br/>query, provides items received from the `MongoOperations#find()` method.                                                                                                                                                                                                                                      |
|            Neo4jItemReader             |                                                                                                                                                                                                                              Given a `Neo4jOperations` object and the components of a<br/>Cyhper query, items are returned as the result of the Neo4jOperations.query<br/>method.                                                                                                                                                                                                                               |
|          RepositoryItemReader          |                                                                                                                                                                                                               Given a Spring Data `PagingAndSortingRepository` object,<br/>a `Sort`, and the name of method to execute, returns items provided by the<br/>Spring Data repository implementation.                                                                                                                                                                                                                |
|       StoredProcedureItemReader        |                                                                                                                                                                                                                Reads from a database cursor resulting from the<br/>execution of a database stored procedure. See [`StoredProcedureItemReader`](readersAndWriters.html#StoredProcedureItemReader)                                                                                                                                                                                                                |
|          StaxEventItemReader           |                                                                                                                                                                                                                                                            Reads via StAX. see [`StaxEventItemReader`](readersAndWriters.html#StaxEventItemReader).                                                                                                                                                                                                                                                             |
|             JsonItemReader             |                                                                                                                                                                                                                                                        Reads items from a Json document. see [`JsonItemReader`](readersAndWriters.html#JsonItemReader).                                                                                                                                                                                                                                                         |

### Item Writers

|             Item Writer              |                                                                                                                            Description                                                                                                                            |
|--------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|     AbstractItemStreamItemWriter     |                                                                                           Abstract base class that combines the`ItemStream` and`ItemWriter` interfaces.                                                                                           |
|            AmqpItemWriter            |                                                          Given a Spring `AmqpTemplate`, it provides<br/>for a synchronous `send` method. The `convertAndSend(Object)`method lets you send POJO objects.                                                           |
|         CompositeItemWriter          |                                                                                  Passes an item to the `write` method of each<br/>in an injected `List` of `ItemWriter` objects.                                                                                  |
|          FlatFileItemWriter          |                                                       Writes to a flat file. Includes `ItemStream` and<br/>Skippable functionality. See [`FlatFileItemWriter`](readersAndWriters.html#flatFileItemWriter).                                                        |
|          GemfireItemWriter           |                                                     Using a `GemfireOperations` object, items are either written<br/>or removed from the Gemfire instance based on the configuration of the delete<br/>flag.                                                      |
|         HibernateItemWriter          |            This item writer is Hibernate-session aware<br/>and handles some transaction-related work that a non-"hibernate-aware"<br/>item writer would not need to know about and then delegates<br/>to another item writer to do the actual writing.            |
|          ItemWriterAdapter           |                                                                                                          Adapts any class to the`ItemWriter` interface.                                                                                                           |
|         JdbcBatchItemWriter          |                                                              Uses batching features from a`PreparedStatement`, if available, and can<br/>take rudimentary steps to locate a failure during a`flush`.                                                              |
|            JmsItemWriter             |                                                                  Using a `JmsOperations` object, items are written<br/>to the default queue through the `JmsOperations#convertAndSend()` method.                                                                  |
|            JpaItemWriter             |                   This item writer is JPA EntityManager-aware<br/>and handles some transaction-related work that a non-"JPA-aware"`ItemWriter` would not need to know about and<br/>then delegates to another writer to do the actual writing.                    |
|           KafkaItemWriter            |Using a `KafkaTemplate` object, items are written to the default topic through the`KafkaTemplate#sendDefault(Object, Object)` method using a `Converter` to map the key from the item.<br/>A delete flag can also be configured to send delete events to the topic.|
|        MimeMessageItemWriter         |                                                                                      Using Spring’s `JavaMailSender`, items of type `MimeMessage`are sent as mail messages.                                                                                       |
|           MongoItemWriter            |                             Given a `MongoOperations` object, items are written<br/>through the `MongoOperations.save(Object)` method. The actual write is delayed<br/>until the last possible moment before the transaction commits.                             |
|           Neo4jItemWriter            |                                                Given a `Neo4jOperations` object, items are persisted through the`save(Object)` method or deleted through the `delete(Object)` per the`ItemWriter’s` configuration                                                 |
|PropertyExtractingDelegatingItemWriter|       Extends `AbstractMethodInvokingDelegator`creating arguments on the fly. Arguments are created by retrieving<br/>the values from the fields in the item to be processed (through a`SpringBeanWrapper`), based on an injected array of field<br/>names.       |
|         RepositoryItemWriter         |                                                                    Given a Spring Data `CrudRepository` implementation,<br/>items are saved through the method specified in the configuration.                                                                    |
|         StaxEventItemWriter          |                                                                       Uses a `Marshaller` implementation to<br/>convert each item to XML and then writes it to an XML file using<br/>StAX.                                                                        |
|          JsonFileItemWriter          |                                                                         Uses a `JsonObjectMarshaller` implementation to<br/>convert each item to Json and then writes it to an Json file.