0:02 first let's check this introduction
0:06 about spring batch so many applications
0:09 within the Enterprise domain require bu
0:11 processing to perform business
0:13 operations in Mission critical
0:15 environments so these businesses
0:18 operation includes first we have
0:21 automated complex processing of large
0:24 volumes of information that is most
0:27 efficiently processed without user
0:30 interaction so these operations
0:33 typically include time based events such
0:36 as month end calculations notice or
0:39 correspondence then periodic application
0:41 of complex business rules processed
0:45 repetitively across very large data sets
0:47 for example insurance benefit
0:50 determination or rate adjustments and
0:53 finally integration of information that
0:56 is received from internal and external
0:59 systems that typically requires formatting
1:00 formatting
1:02 validation and processing in a
1:05 transactional manner into this system of
1:08 record so batch processing is used to
1:11 process billions of transactions every
1:14 day for Enterprises now let's see what
1:16 is spring batch so spring batch is a
1:18 lightweight comprehensive batch
1:21 framework designed to enable the
1:24 development of robust batch applications
1:27 that are vital to the daily operations
1:30 of Enterprise systems spring batch
1:32 builds upon the characteristics of the
1:35 spring framework that people have come
1:38 to expect productivity poates
1:40 development approach and general ease of
1:43 use while making it easy for developers
1:46 to access and use more advanced
1:48 Enterprise Services when necessary
1:51 spring batch is not a scheduling
1:55 framework there are many good Enterprise
1:58 schedulers such as gartz T control M and
2:01 others if available in both the
2:03 commercial and open-source spaces so
2:06 spring batch is intended to work in
2:09 conjunction with aular rather than
2:12 replacing the schedul itself spring
2:15 batch provides reusable functions that
2:17 are essential in processing large
2:20 volumes of records including logging and
2:23 tracing transaction management job
2:26 processing statistics job restart Skip
2:29 and Resource Management it also provides
2:31 more more advanced Technical Services
2:35 and feature that enable externally high
2:38 volume and high performance batch jobs
2:41 through optimization and partitioning
2:44 techniques you can use spring batch in
2:47 both simple use case such as reading a
2:50 file into a database or running stored
2:53 procedures and complex high volume use
2:56 cases such as moving High volumes of
3:00 data between databases transforming it
3:03 and so and so forth high volume batch
3:06 jobs use the framework in a highly
3:09 scalable manner to process significant
3:11 volumes of information so what is the
3:15 background of spring batch so while
3:17 open-source software projects and
3:20 Associated communities have focused
3:22 greater attention on web based and
3:24 microservices based architecture
3:28 framework there has been a notable lack
3:30 of focus on reusable architecture
3:33 Frameworks to accommodate Java based
3:37 batch processing needs despite continued
3:40 needs to handle such processing with
3:43 Enterprise it environment so the lack of
3:46 a standard reusable batch architecture
3:49 has resulted in the proliferation of
3:52 many oneoff inh house solution developed
3:56 within client Enterprise it functions so
3:59 spring source which is now VMware and
4:02 Accenture collaborated to change this
4:05 Accenture handson industry and Technical
4:07 expertise in implementing bat
4:10 architecture spring Source depth of
4:13 technical experience and spring proven
4:15 programming model Together made a
4:18 natural and Powerful partnership to
4:21 create high quality Market relevant
4:23 software aimed at filling an important
4:26 Gap in Enterprise Java both companies
4:29 they worked with a number of clients who
4:32 were solving similar Problems by
4:34 developing spring based batch
4:37 architecture Solutions so this input
4:39 provided some useful additional detail
4:42 and real life constraints that help to
4:45 ensure the solution can be applied to
4:48 the real world problems posed by clients
4:50 accenter contributed previously
4:52 proprietary batch processing
4:55 architecture Frameworks to the spring
4:57 batch project along with committer
5:01 resource to drive support enhancement
5:03 and the existing feature set so
5:06 Accenture contribution was based upon
5:09 Decades of experience in building batch
5:12 architectures with the last several
5:15 generation of platforms such as Cobalt
5:19 on Main frames C++ on Unix and now Java
5:22 anywhere so the collaborative effort
5:24 between Accenture and spring Source
5:27 aimed to promote the standardization of
5:29 software processing approach frame works
5:32 and tools Enterprise users can
5:36 consistently use when creating badge
5:38 applications companies and government
5:41 agencies Desiring to deliver standard
5:44 proven solution to their Enterprise it
5:48 environment can benefit from Spring
5:52 batch the following diagram is a
5:53 simplified version of the batch
5:56 reference architecture that has been
5:58 used for decades so it provides an
6:01 overview of the components that make up
6:04 the domain language of batch processing
6:06 so this architecture framework is a
6:09 blueprint that have been or that has
6:11 been proven through Decades of
6:14 implementation on the last several
6:16 generation of platforms so spring batch
6:19 provides a physical implementation of
6:21 the layers component and Technical
6:24 Services commonly found in the robust
6:26 maintainable systems that are used to
6:29 address the creation of simple to comp
6:31 complex batch applications with
6:34 infrastructure and the extensions to
6:37 address very complex processing needs
6:39 now let's break down each component and
6:42 each part of this diagram and explain
6:44 them separately so in batch processing
6:46 we have several components first let's
6:48 start with the job luncher so the job
6:51 luncher is simply an interface for
6:54 lunching a job with a given set of job
6:56 parameters so we will see later on what
6:59 are job parameters and how we can pass
7:01 them and then each job launcher will
7:04 launch a job the job it's a section that
7:07 I will explain in just few moments in
7:10 details and then each job might have or
7:14 can have one or several several steps so
7:16 here we can see step one and step n and
7:19 each step is composed of three main
7:23 elements so the first thing is an item
7:25 reader so the item reader is an
7:27 abstraction that represents the
7:30 retrieval of input for a step and one
7:33 item at a time so when the item reader
7:36 has exhausted the items it can provide
7:39 it indicates this by returning null so
7:42 when the item reader returns null means
7:45 that we no longer have records or data
7:47 to read so you can Define more details
7:50 about the item reader interface and its
7:53 various implementation in the readers
7:55 and the writers so the item reader is
7:58 able to read data from for example a
8:00 database a file and so and so forth any
8:03 storage system you want and then once we
8:06 read an item we pass it to the item
8:08 processor so the item processor is an
8:11 abstraction that represents the business
8:14 processing of an item so while the item
8:16 reader reads one item and the item
8:19 writer writes one item the item
8:21 processor provides an access point to
8:25 transform or apply other business
8:28 processing if while processing the item
8:31 it is detered that the item is not valid
8:33 returning null indicating that the item
8:36 should not be written out you can find
8:38 out more details about the item
8:41 processor in the interface in readers
8:44 and writers and then finally we have the
8:46 item writer so the item writer is an
8:49 abstraction that represents the output
8:54 of a step so one batch or chank of items
8:57 at a time generally an item writer has
9:00 no knowledge of the input it should
9:03 receive next and knows only the item
9:06 that was passed it in its current
9:08 invocation you can find more details
9:11 about the item writer interface and its
9:13 various implementation in the readers
9:15 and the writers as well and all these
9:18 three parts job luncher job and the
9:21 steps they use and they communicate to
9:24 the job repository so the job repository
9:27 is the the persistence mechanism for all
9:30 of the stereotypes me mentioned earlier
9:32 it provides crude operations for job
9:35 luncher job and step implementations
9:37 when a job is first launched a job
9:40 execution is obtained from the
9:43 repository also during the course of
9:45 execution step execution and job
9:48 execution implementations are persisted
9:51 by passing them to the job repository or
9:54 to this repository when using Java
9:56 configuration The annotation enabled
9:58 batch processing annotation provides the
10:01 job job repository as one of the
10:03 components that is automatically
10:05 configured so this is the global
10:10 overview of the batch architecture now
10:13 let's move on and break down and see how
10:15 the job works now let's break down the
10:19 job so a job is simply a central entity
10:23 that encompasses an enti an entire batch
10:25 process so configured through XML or
10:28 javab base step referred to as job
10:31 config configuration it acts as the top
10:35 level element in hierarchy organizing
10:38 multiple step instances logically these
10:40 steps are grouped within the job to form
10:44 a cohesive flow allowing for Global
10:47 configuration of properties such as
10:49 restartability the job configuration
10:52 includes the job's name the definition
10:55 and ordering of its step instances and
10:58 as specification of whether the job
11:01 restarts or or not then within a job we
11:03 have a job instance a job instance in
11:07 Spring batch represents a distinct run
11:09 of a batch job for example consider an
11:13 end of day job meant to run daily
11:15 despite there being a single end of day
11:19 job each run is tracked as a separate
11:21 job instance like the January 1st or
11:26 January 2nd run even if a run fails and
11:29 is Rerun the next day it retains it
11:32 original identity such as the January 1
11:35 run so each job instance can have
11:38 multiple executions but only one job
11:41 instance associated with specific job
11:44 parameters at every given time so the
11:46 definition of a job instance doesn't
11:49 impact data loading that's determined by
11:51 the item reader implementation for
11:54 instance in an end of day scenario the
11:58 data may include a column indicating the
12:01 effective date the January 1st run for
12:04 instance loads data only from the first
12:07 and the January 2nd runs uses data from
12:10 the second this decision is often a
12:12 business choice for the item reader to
12:15 make however reusing the same job
12:17 instance determines whether the state
12:20 for example the execution context from
12:23 preor executions is utilized starting a
12:26 new job instance means being from the
12:29 start while using an existing instance
12:31 generally means resume from where you
12:34 left off and then after the job instance
12:37 we have a job execution so a job
12:40 execution in Spring batch represents a
12:43 single attempt to run a job which can
12:45 result in success or failure the
12:48 associated job instance is considered
12:50 incomplete until the execution
12:53 successfully completes for instance in
12:56 the context of end of day job if the job
12:58 instance for January 1st fails on each
13:01 initial run and is Rerun with the same
13:04 job parameters a new job execution is
13:07 generated but only one job instance
13:11 persists so globally a job defines what
13:14 a job is and how it is to be executed
13:17 and a job instance is a purely
13:19 organizational object to group
13:22 executions together primarily to enable
13:25 correct restart semantics a job
13:28 execution however is the primary storage
13:30 mechanism of what actually happened
13:33 during a run and contains many more
13:35 properties that must be controlled and
13:39 persisted a step is a domain object that
13:41 encapsulates an independent sequential
13:45 phase of a batch job therefore every job
13:48 is composed entirely of one or more
13:51 steps so a step contains all the
13:53 information necessary to Define and
13:56 control the actual batch processing so
13:58 this is necessarily vag descript
14:01 description because the contents of Any
14:04 Given steps are the discretion of the
14:08 developer writing a job so a step can be
14:11 as simpler or as complex as a developer
14:15 desires so a simple step might load data
14:18 from a file into database requiring
14:21 little or no code depending upon the
14:24 implementation used a more complex tip
14:26 may have complicated business rules that
14:30 are applied as part of the processing as
14:34 with a job a step has an individual step
14:37 execution that correlates with a unique job
14:38 job
14:42 execution so a step execution represents
14:45 a single attempt to execute a step a new
14:48 Step execution is created each time a
14:52 step is run similar to the job execution
14:55 however if a step fails to execute
14:58 because the step before it fails no EXE
15:01 execution is persisted for it a step
15:04 execution is created only when each step
15:07 is actually started and step executions
15:10 are represented by objects of the step
15:14 execution class each execution contains
15:17 a reference to its corresponding step
15:20 and job execution and transaction
15:23 related data such as commit or roll back
15:26 counts and start and end time
15:29 additionally each step EX execution
15:32 contains an execution context which
15:35 contains any data a developer needs to
15:39 have persisted across batch runs such as
15:42 statistics or state information needed