Batch models
The Java Batch API (JSR 352) allows executing batch activities based on a Job Specification Language (JSL) using two main programming models: Chunk steps and Batchlets. The JSL is the XML descriptor file used to configure the processes and all its components as the steps and the Batchlets.
In this section, we will see samples of JSL and two samples of chunks and Batchlets.
Chunks
A chunk is a small part of the process working in a number of processes. It is the right actor to handle batches with large data queues. A set of chunk forms a process. It's very useful in massive boots when you need to organize your work into small steps.
For example, during a data migration, we will need to commit the operation any certain time. The chunk mode is done in three steps:

In the first step, an item is read and then processed. According to the chosen number of chunks, the item will be written and the cycle restarted until the payload doesn't end. Here's a sample of JSL code:
<job id="PayrollJob...