I understood that spring batch framework processes data in chunks. However, I was thinking that when the same chunking functionality can be acheived through java why do we need to go for batch framework.
Could any one please let me know if there are more reasons for going to spring batch framework?
Spring Batch provides reusable functions that are essential in processing large volumes of records, including logging/tracing, transaction management, job processing statistics, job restart, skip, and resource management.
Let me rephrase your question a bit and see if this addresses it.
What does Spring Batch provide that I'd have to handle myself when building a batch application?
Spring Batch served as the basis for JSR-352 (the java batch specification) and since that specification has come out, there is a lot of Spring Batch now available within the java space. That being said, there is still a lot that Spring Batch provides outside of the scope of what basic Java does:
Within a "basic" batch job
Within the scope of a simple batch job, Spring Batch provides a collection of utilities and implementations that have been battle tested in all enterprise verticals. Some examples are:
ItemReader
and 15 ItemWriter
implementations covering vast options for input and output (File, JDBC, NoSQL, JMS, etc). All of these provide declarative I/O options so that you don't have to write and test code for stateful readers and writers.Tasklet
(Spring Batch's equivalent to JSR-352's Batchlet
) implementations including ones for executing shell commands and interfacing with Hadoop.Additional advantages
Beyond the above examples of what Spring Batch brings to the table, it goes much further:
I personally view batch processing as the "set it and forget it" model of programming. While it isn't sexy, batch processing is a very useful model of processing and is more useful in places than most people realize. Spring Batch provides an environment that makes developing robust batch jobs as easily as possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With