Java Reference
In-Depth Information
C H A P T E R 1
Batch and Spring
When I graduated from Northern Illinois University back in 2001 after spending most of the previous two
years working on COBOL, mainframe Assembler, and Job Control Language (JCL), I took a job as a
consultant to learn Java. I specifically took that position because of the opportunity to learn Java when it
was the hot new thing. Never in my wildest dreams did I think I'd be back writing about batch
processing. I'm sure most Java developers don't think about batch, either. They think about the latest
web framework or JVM language. They think about service-oriented architectures and things like REST
versus SOAP or whatever alphabet soup is hot at the time.
But the fact is, the business world runs on batch. Your bank and 401k statements are all generated
via batch processes. The e-mails you receive from your favorite stores with coupons in them? Probably
sent via batch processes. Even the order in which the repair guy comes to your house to fix your laundry
machine is determined by batch processing. In a time when we get our news from Twitter, Google thinks
that waiting for a page refresh takes too long to provide search results, and YouTube can make someone
a household name overnight, why do we need batch processing at all?
There are a few good reasons:
You don't always have all the required information immediately. Batch processing
allows you to collect information required for a given process before starting the
required processing. Take your monthly bank statement as an example. Does it
make sense to generate the file format for your printed statement after every
transaction? It makes more sense to wait until the end of the month and look back
at a vetted list of transactions from which to build the statement.
Sometimes it makes good business sense. Although most people would love to
have what they buy online put on a delivery truck the second they click Buy, that
may not be the best course of action for the retailer. If a customer changes their
mind and wants to cancel an order, it's much cheaper to cancel if it hasn't shipped
yet. Giving the customer a few extra hours and batching the shipping together can
save the retailer large amounts of money
It can be a better use of resources. Having a lot of processing power sitting idle is
expensive. It's more cost effective to have a collection of scheduled processes that
run one after the other using the machine's full potential at a constant,
predictable rate.
This topic is about batch processing with the framework Spring Batch. This chapter looks at the
history of batch processing, calls out the challenges in developing batch jobs, makes a case for
developing batch using Java and Spring Batch, and finally provides a high-level overview of the
framework and its features.
Search WWH ::

Custom Search