Spring Batch Architecture
Spring Batch is based on layered architecture focusing on extensibility and diverse group of end users in mind. The layered architecture consists of three main components namely: Application, Batch Core along with Batch environment and Infrastructure as show in Figure 23-2 below.
Figure 23-2. Spring Batch architecture
The various components in Spring Batch framework can be summarized as below:
- Application contains all batch jobs and custom code written by developers using Spring Batch.
- Batch core conmtains the core runtime classes necessary to launch and control a batch job. It includes things such as a JobLauncher, Job and Step implementations.
- Batch Infrastructure contains common readers and writers, and services which are used both by application developers and the core framework itself.
Spring Batch Dependency
Spring Batch’s dependency can be pictorially depicted as shown in Figure 23-3 below.
Figure 23-3. Spring Batch dependency
Spring Batch Domain
To understand and comprehend Spring Batch better you need to first understand the various concepts and terminologies used in a typical batch program especially with respect to Spring Batch. This section aims at bringing the concepts to the table as these are very much essential for understanding the following sections of this Chapter. Please have a look at the Figure 23-4 below closely.
Figure 23-4. Key concepts that make up the domain language of batch
In simple terms Figure 23-4 can be explained as follows:
- Its JobLauncher’s responsibility to launch a Job
- A Job is an entity which comprises of multiple Step’s
- Each Step can have exactly one ItemReader, ItemProcessor and ItemWriter
- All the required meta-data about the current running process is stored in the JobRepository
Before going through the working of Spring Batch in detail, I would like you to go through the Spring Batch domain objects as explained in the following sections so that you can relate the various domain objects in this diagram completely. While explaining each domain object we will be looking into as to how it fits into Figure 23-4 above. After going through this section, come back and have a look at the Figure 23-4 above and I am sure you will comprehend it much easily.
Page Visitors: 23815