There is a central concept in Spring Batch (in all batch processing) of the unit of work. Usually an item is read from an input source and processed. The item might be a message, line from a file, record from a database table, etc. The combination of the input and output is common, and there are also jobs which combine the two into a single operation. Transaction boundaries are usually set at the level of several of these units of work (a "batch", or a "chunk"). The interface is pretty much fixed:
implementations return false to inform the framework that there is no more processing to be done (data are exhausted).Code:public boolean execute();
Some pros and cons: "unit of work" has definite connotations of a transaction (which we are only a part of). "Module" is the name used at the moment, but it is a) bland, b) clashes with other uses, principally in OSGi. So we hate it, but it's on the list in case anyone actually disagrees.


Reply With Quote
