Architecture of a batch job
Let's depict the basic architecture of a batch processor; we can also see the components involved in the batch processing. From the following diagram you can figure out the main components of Spring Batch:
Let's now have a look at the components individually.
JobRepository
: This container is where we need to register our jobs or processes.JobOperator
: This is the one that triggers the registered job. It also provides APIs for accessing the register. It is an interface.Job
: It is a process or task in thejobRepository
. This consists of one more step.Step
: This actually contains the logic that needs to be executed. Each step consists of anItemReader
,ItemProcessor
, andItemWriter
interface. First, theItemReader
interface reads one step at a time in a job and gives it toItemProcessor
which processes the job. For example, it might collect some data required. Then, theItemWriter
interface writes the data to the database or it might execute a transaction...