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