5 lines
19 KiB
HTML
5 lines
19 KiB
HTML
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg"><head><title>Spring Batch - Reference Documentation</title><link rel="stylesheet" type="text/css" href="docbook-epub.css"/><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/></head><body><header/><h1>Spring Batch - Reference Documentation</h1><div class="toc"><div class="toc-title">Table of Contents</div><nav epub:type="toc"><ol><li><a href="ch01.xhtml">1. Spring Batch Introduction</a><ol><li><a href="ch01.xhtml#springBatchBackground">Background</a></li><li><a href="ch01s02.xhtml">Usage Scenarios</a></li><li><a href="ch01s03.xhtml">Spring Batch Architecture</a></li><li><a href="ch01s04.xhtml">General Batch Principles and Guidelines</a></li><li><a href="ch01s05.xhtml">Batch Processing Strategies</a></li></ol></li><li><a href="ch02.xhtml">2. What's New in Spring Batch 4.0</a><ol><li><a href="ch02.xhtml#whatsNewJava">Java 8 Requirement</a></li><li><a href="ch02s02.xhtml">Dependencies re-baseline</a></li><li><a href="ch02s03.xhtml">Provide builders for the ItemReaders and ItemWriters</a></li></ol></li><li><a href="ch03.xhtml">3. The Domain Language of Batch</a><ol><li><a href="ch03.xhtml#domainJob">Job</a><ol><li><a href="ch03.xhtml#domainJobInstance">JobInstance</a></li><li><a href="ch03.xhtml#domainJobParameters">JobParameters</a></li><li><a href="ch03.xhtml#domainJobExecution">JobExecution</a></li></ol></li><li><a href="ch03s02.xhtml">Step</a><ol><li><a href="ch03s02.xhtml#domainStepExecution">StepExecution</a></li></ol></li><li><a href="ch03s03.xhtml">ExecutionContext</a></li><li><a href="ch03s04.xhtml">JobRepository</a></li><li><a href="ch03s05.xhtml">JobLauncher</a></li><li><a href="ch03s06.xhtml">Item Reader</a></li><li><a href="ch03s07.xhtml">Item Writer</a></li><li><a href="ch03s08.xhtml">Item Processor</a></li><li><a href="ch03s09.xhtml">Batch Namespace</a></li></ol></li><li><a href="ch04.xhtml">4. Configuring and Running a Job</a><ol><li><a href="ch04.xhtml#configuringAJob">Configuring a Job</a><ol><li><a href="ch04.xhtml#restartability">Restartability</a></li><li><a href="ch04.xhtml#interceptingJobExecution">Intercepting Job Execution</a></li><li><a href="ch04.xhtml#inheritingFromAParentJob">Inheriting from a Parent Job</a></li><li><a href="ch04.xhtml#d5e953">JobParametersValidator</a></li></ol></li><li><a href="ch04s02.xhtml">Java Config</a></li><li><a href="ch04s03.xhtml">Configuring a JobRepository</a><ol><li><a href="ch04s03.xhtml#txConfigForJobRepository">Transaction Configuration for the JobRepository</a></li><li><a href="ch04s03.xhtml#repositoryTablePrefix">Changing the Table Prefix</a></li><li><a href="ch04s03.xhtml#inMemoryRepository">In-Memory Repository</a></li><li><a href="ch04s03.xhtml#nonStandardDatabaseTypesInRepository">Non-standard Database Types in a Repository</a></li></ol></li><li><a href="ch04s04.xhtml">Configuring a JobLauncher</a></li><li><a href="ch04s05.xhtml">Running a Job</a><ol><li><a href="ch04s05.xhtml#runningJobsFromCommandLine">Running Jobs from the Command Line</a><ol><li><a href="ch04s05.xhtml#commandLineJobRunner">The CommandLineJobRunner</a></li><li><a href="ch04s05.xhtml#exitCodes">ExitCodes</a></li></ol></li><li><a href="ch04s05.xhtml#runningJobsFromWebContainer">Running Jobs from within a Web Container</a></li></ol></li><li><a href="ch04s06.xhtml">Advanced Meta-Data Usage</a><ol><li><a href="ch04s06.xhtml#queryingRepository">Querying the Repository</a></li><li><a href="ch04s06.xhtml#d5e1215">JobRegistry</a><ol><li><a href="ch04s06.xhtml#d5e1220">JobRegistryBeanPostProcessor</a></li><li><a href="ch04s06.xhtml#d5e1225">AutomaticJobRegistrar</a></li></ol></li><li><a href="ch04s06.xhtml#JobOperator">JobOperator</a></li><li><a href="ch04s06.xhtml#JobParametersIncrementer">JobParametersIncrementer</a></li><li><a href="ch04s06.xhtml#stoppingAJob">Stopping a Job</a></li><li><a href="ch04s06.xhtml#d5e1303">Aborting a Job</a></li></ol></li></ol></li><li><a href="ch05.xhtml">5. Configuring a Step</a><ol><li><a href="ch05.xhtml#chunkOrientedProcessing">Chunk-Oriented Processing</a><ol><li><a href="ch05.xhtml#configuringAStep">Configuring a Step</a></li><li><a href="ch05.xhtml#InheritingFromParentStep">Inheriting from a Parent Step</a><ol><li><a href="ch05.xhtml#abstractStep">Abstract Step</a></li><li><a href="ch05.xhtml#mergingListsOnStep">Merging Lists</a></li></ol></li><li><a href="ch05.xhtml#commitInterval">The Commit Interval</a></li><li><a href="ch05.xhtml#stepRestart">Configuring a Step for Restart</a><ol><li><a href="ch05.xhtml#startLimit">Setting a StartLimit</a></li><li><a href="ch05.xhtml#allowStartIfComplete">Restarting a completed step</a></li><li><a href="ch05.xhtml#stepRestartExample">Step Restart Configuration Example</a></li></ol></li><li><a href="ch05.xhtml#configuringSkip">Configuring Skip Logic</a></li><li><a href="ch05.xhtml#retryLogic">Configuring Retry Logic</a></li><li><a href="ch05.xhtml#controllingRollback">Controlling Rollback</a><ol><li><a href="ch05.xhtml#transactionalReaders">Transactional Readers</a></li></ol></li><li><a href="ch05.xhtml#transactionAttributes">Transaction Attributes</a></li><li><a href="ch05.xhtml#registeringItemStreams">Registering ItemStreams with the Step</a></li><li><a href="ch05.xhtml#interceptingStepExecution">Intercepting Step Execution</a><ol><li><a href="ch05.xhtml#stepExecutionListener">StepExecutionListener</a></li><li><a href="ch05.xhtml#chunkListener">ChunkListener</a></li><li><a href="ch05.xhtml#itemReadListener">ItemReadListener</a></li><li><a href="ch05.xhtml#itemProcessListener">ItemProcessListener</a></li><li><a href="ch05.xhtml#itemWriteListener">ItemWriteListener</a></li><li><a href="ch05.xhtml#skipListener">SkipListener</a><ol hidden=""><li><a href="ch05.xhtml#skipListenersAndTransactions">SkipListeners and Transactions</a></li></ol></li></ol></li></ol></li><li><a href="ch05s02.xhtml">TaskletStep</a><ol><li><a href="ch05s02.xhtml#taskletAdapter">TaskletAdapter</a></li><li><a href="ch05s02.xhtml#exampleTaskletImplementation">Example Tasklet Implementation</a></li></ol></li><li><a href="ch05s03.xhtml">Controlling Step Flow</a><ol><li><a href="ch05s03.xhtml#SequentialFlow">Sequential Flow</a></li><li><a href="ch05s03.xhtml#conditionalFlow">Conditional Flow</a><ol><li><a href="ch05s03.xhtml#batchStatusVsExitStatus">Batch Status vs. Exit Status</a></li></ol></li><li><a href="ch05s03.xhtml#configuringForStop">Configuring for Stop</a><ol><li><a href="ch05s03.xhtml#endElement">The 'End' Element</a></li><li><a href="ch05s03.xhtml#failElement">The 'Fail' Element</a></li><li><a href="ch05s03.xhtml#stopElement">The 'Stop' Element</a></li></ol></li><li><a href="ch05s03.xhtml#programmaticFlowDecisions">Programmatic Flow Decisions</a></li><li><a href="ch05s03.xhtml#split-flows">Split Flows</a></li><li><a href="ch05s03.xhtml#external-flows">Externalizing Flow Definitions and Dependencies Between
|
|
Jobs</a></li></ol></li><li><a href="ch05s04.xhtml">Late Binding of Job and Step Attributes</a><ol><li><a href="ch05s04.xhtml#step-scope">Step Scope</a></li><li><a href="ch05s04.xhtml#job-scope">Job Scope</a></li></ol></li></ol></li><li><a href="ch06.xhtml">6. ItemReaders and ItemWriters</a><ol><li><a href="ch06.xhtml#itemReader">ItemReader</a></li><li><a href="ch06s02.xhtml">ItemWriter</a></li><li><a href="ch06s03.xhtml">ItemProcessor</a><ol><li><a href="ch06s03.xhtml#chainingItemProcessors">Chaining ItemProcessors</a></li><li><a href="ch06s03.xhtml#filiteringRecords">Filtering Records</a></li><li><a href="ch06s03.xhtml#faultTolerant">Fault Tolerance</a></li></ol></li><li><a href="ch06s04.xhtml">ItemStream</a></li><li><a href="ch06s05.xhtml">The Delegate Pattern and Registering with the Step</a></li><li><a href="ch06s06.xhtml">Flat Files</a><ol><li><a href="ch06s06.xhtml#fieldSet">The FieldSet</a></li><li><a href="ch06s06.xhtml#flatFileItemReader">FlatFileItemReader</a><ol><li><a href="ch06s06.xhtml#lineMapper">LineMapper</a></li><li><a href="ch06s06.xhtml#lineTokenizer">LineTokenizer</a></li><li><a href="ch06s06.xhtml#fieldSetMapper">FieldSetMapper</a></li><li><a href="ch06s06.xhtml#defaultLineMapper">DefaultLineMapper</a></li><li><a href="ch06s06.xhtml#simpleDelimitedFileReadingExample">Simple Delimited File Reading Example</a></li><li><a href="ch06s06.xhtml#mappingFieldsByName">Mapping Fields by Name</a></li><li><a href="ch06s06.xhtml#beanWrapperFieldSetMapper">Automapping FieldSets to Domain Objects</a></li><li><a href="ch06s06.xhtml#fixedLengthFileFormats">Fixed Length File Formats</a></li><li><a href="ch06s06.xhtml#prefixMatchingLineMapper">Multiple Record Types within a Single File</a></li><li><a href="ch06s06.xhtml#exceptionHandlingInFlatFiles">Exception Handling in Flat Files</a><ol hidden=""><li><a href="ch06s06.xhtml#incorrectTokenCountException">IncorrectTokenCountException</a></li><li><a href="ch06s06.xhtml#incorrectLineLengthException">IncorrectLineLengthException</a></li></ol></li></ol></li><li><a href="ch06s06.xhtml#flatFileItemWriter">FlatFileItemWriter</a><ol><li><a href="ch06s06.xhtml#lineAggregator">LineAggregator</a><ol hidden=""><li><a href="ch06s06.xhtml#PassThroughLineAggregator">PassThroughLineAggregator</a></li></ol></li><li><a href="ch06s06.xhtml#SimplifiedFileWritingExample">Simplified File Writing Example</a></li><li><a href="ch06s06.xhtml#FieldExtractor">FieldExtractor</a><ol hidden=""><li><a href="ch06s06.xhtml#PassThroughFieldExtractor">PassThroughFieldExtractor</a></li><li><a href="ch06s06.xhtml#BeanWrapperFieldExtractor">BeanWrapperFieldExtractor</a></li></ol></li><li><a href="ch06s06.xhtml#delimitedFileWritingExample">Delimited File Writing Example</a></li><li><a href="ch06s06.xhtml#fixedWidthFileWritingExample">Fixed Width File Writing Example</a></li><li><a href="ch06s06.xhtml#handlingFileCreation">Handling File Creation</a></li></ol></li></ol></li><li><a href="ch06s07.xhtml">XML Item Readers and Writers</a><ol><li><a href="ch06s07.xhtml#StaxEventItemReader">StaxEventItemReader</a></li><li><a href="ch06s07.xhtml#StaxEventItemWriter">StaxEventItemWriter</a></li></ol></li><li><a href="ch06s08.xhtml">Multi-File Input</a></li><li><a href="ch06s09.xhtml">Database</a><ol><li><a href="ch06s09.xhtml#cursorBasedItemReaders">Cursor Based ItemReaders</a><ol><li><a href="ch06s09.xhtml#JdbcCursorItemReader">JdbcCursorItemReader</a><ol hidden=""><li><a href="ch06s09.xhtml#JdbcCursorItemReaderProperties">Additional Properties</a></li></ol></li><li><a href="ch06s09.xhtml#HibernateCursorItemReader">HibernateCursorItemReader</a></li><li><a href="ch06s09.xhtml#StoredProcedureItemReader">StoredProcedureItemReader</a></li></ol></li><li><a href="ch06s09.xhtml#pagingItemReaders">Paging ItemReaders</a><ol><li><a href="ch06s09.xhtml#JdbcPagingItemReader">JdbcPagingItemReader</a></li><li><a href="ch06s09.xhtml#JpaPagingItemReader">JpaPagingItemReader</a></li><li><a href="ch06s09.xhtml#IbatisPagingItemReader">IbatisPagingItemReader</a></li></ol></li><li><a href="ch06s09.xhtml#databaseItemWriters">Database ItemWriters</a></li></ol></li><li><a href="ch06s10.xhtml">Reusing Existing Services</a></li><li><a href="ch06s11.xhtml">Validating Input</a></li><li><a href="ch06s12.xhtml">Preventing State Persistence</a></li><li><a href="ch06s13.xhtml">Creating Custom ItemReaders and
|
|
ItemWriters</a><ol><li><a href="ch06s13.xhtml#customReader">Custom ItemReader Example</a><ol><li><a href="ch06s13.xhtml#restartableReader">Making the <code class="classname">ItemReader</code>
|
|
Restartable</a></li></ol></li><li><a href="ch06s13.xhtml#customWriter">Custom ItemWriter Example</a><ol><li><a href="ch06s13.xhtml#restartableWriter">Making the <code class="classname">ItemWriter</code>
|
|
Restartable</a></li></ol></li></ol></li></ol></li><li><a href="ch07.xhtml">7. Scaling and Parallel Processing</a><ol><li><a href="ch07.xhtml#multithreadedStep">Multi-threaded Step</a></li><li><a href="ch07s02.xhtml">Parallel Steps</a></li><li><a href="ch07s03.xhtml">Remote Chunking</a></li><li><a href="ch07s04.xhtml">Partitioning</a><ol><li><a href="ch07s04.xhtml#partitionHandler">PartitionHandler</a></li><li><a href="ch07s04.xhtml#stepExecutionSplitter">Partitioner</a></li><li><a href="ch07s04.xhtml#bindingInputDataToSteps">Binding Input Data to Steps</a></li></ol></li></ol></li><li><a href="ch08.xhtml">8. Repeat</a><ol><li><a href="ch08.xhtml#repeatTemplate">RepeatTemplate</a><ol><li><a href="ch08.xhtml#repeatContext">RepeatContext</a></li><li><a href="ch08.xhtml#repeatStatus">RepeatStatus</a></li></ol></li><li><a href="ch08s02.xhtml">Completion Policies</a></li><li><a href="ch08s03.xhtml">Exception Handling</a></li><li><a href="ch08s04.xhtml">Listeners</a></li><li><a href="ch08s05.xhtml">Parallel Processing</a></li><li><a href="ch08s06.xhtml">Declarative Iteration</a></li></ol></li><li><a href="ch09.xhtml">9. Retry</a><ol><li><a href="ch09.xhtml#retryTemplate">RetryTemplate</a><ol><li><a href="ch09.xhtml#retryContext">RetryContext</a></li><li><a href="ch09.xhtml#recoveryCallback">RecoveryCallback</a></li><li><a href="ch09.xhtml#statelessRetry">Stateless Retry</a></li><li><a href="ch09.xhtml#statefulRetry">Stateful Retry</a></li></ol></li><li><a href="ch09s02.xhtml">Retry Policies</a></li><li><a href="ch09s03.xhtml">Backoff Policies</a></li><li><a href="ch09s04.xhtml">Listeners</a></li><li><a href="ch09s05.xhtml">Declarative Retry</a></li></ol></li><li><a href="ch10.xhtml">10. Unit Testing</a><ol><li><a href="ch10.xhtml#creatingUnitTestClass">Creating a Unit Test Class</a></li><li><a href="ch10s02.xhtml">End-To-End Testing of Batch Jobs</a></li><li><a href="ch10s03.xhtml">Testing Individual Steps</a></li><li><a href="ch10s04.xhtml">Testing Step-Scoped Components</a></li><li><a href="ch10s05.xhtml">Validating Output Files</a></li><li><a href="ch10s06.xhtml">Mocking Domain Objects</a></li></ol></li><li><a href="ch11.xhtml">11. Common Batch Patterns</a><ol><li><a href="ch11.xhtml#loggingItemProcessingAndFailures">Logging Item Processing and Failures</a></li><li><a href="ch11s02.xhtml">Stopping a Job Manually for Business Reasons</a></li><li><a href="ch11s03.xhtml">Adding a Footer Record</a><ol><li><a href="ch11s03.xhtml#writingASummaryFooter">Writing a Summary Footer</a></li></ol></li><li><a href="ch11s04.xhtml">Driving Query Based ItemReaders</a></li><li><a href="ch11s05.xhtml">Multi-Line Records</a></li><li><a href="ch11s06.xhtml">Executing System Commands</a></li><li><a href="ch11s07.xhtml">Handling Step Completion When No Input is Found</a></li><li><a href="ch11s08.xhtml">Passing Data to Future Steps</a></li></ol></li><li><a href="ch12.xhtml">12. JSR-352 Support</a><ol><li><a href="ch12.xhtml#jsrGeneralNotes">General Notes Spring Batch and JSR-352</a></li><li><a href="ch12s02.xhtml">Setup</a><ol><li><a href="ch12s02.xhtml#jsrSetupContexts">Application Contexts</a></li><li><a href="ch12s02.xhtml#jsrSetupLaunching">Launching a JSR-352 based job</a></li></ol></li><li><a href="ch12s03.xhtml">Dependency Injection</a></li><li><a href="ch12s04.xhtml">Batch Properties</a><ol><li><a href="ch12s04.xhtml#jsrPropertySupport">Property Support</a></li><li><a href="ch12s04.xhtml#jsrBatchPropertyAnnotation"><code class="classname">@BatchProperty</code> annotation</a></li><li><a href="ch12s04.xhtml#jsrPropertySubstitution">Property Substitution</a></li></ol></li><li><a href="ch12s05.xhtml">Processing Models</a><ol><li><a href="ch12s05.xhtml#d5e3942">Item based processing</a></li><li><a href="ch12s05.xhtml#d5e3952">Custom checkpointing</a></li></ol></li><li><a href="ch12s06.xhtml">Running a job</a></li><li><a href="ch12s07.xhtml">Contexts</a></li><li><a href="ch12s08.xhtml">Step Flow</a></li><li><a href="ch12s09.xhtml">Scaling a JSR-352 batch job</a><ol><li><a href="ch12s09.xhtml#jsrPartitioning">Partitioning</a></li></ol></li><li><a href="ch12s10.xhtml">Testing</a></li></ol></li><li><a href="ch13.xhtml">13. Spring Batch Integration</a><ol><li><a href="ch13.xhtml#spring-batch-integration-introduction">Spring Batch Integration Introduction</a><ol><li><a href="ch13.xhtml#namespace-support">Namespace Support</a></li><li><a href="ch13.xhtml#launching-batch-jobs-through-messages">Launching Batch Jobs through Messages</a><ol><li><a href="ch13.xhtml#transforming-a-file-into-a-joblaunchrequest">Transforming a file into a JobLaunchRequest</a></li><li><a href="ch13.xhtml#the-jobexecution-response">The JobExecution Response</a></li><li><a href="ch13.xhtml#spring-batch-integration-configuration">Spring Batch Integration Configuration</a></li><li><a href="ch13.xhtml#example-itemreader-configuration">Example ItemReader Configuration</a><ol hidden=""><li><a href="ch13.xhtml#available-attributes-of-the-job-launching-gateway">Available Attributes of the Job-Launching Gateway</a></li><li><a href="ch13.xhtml#sub-elements">Sub-Elements</a></li></ol></li></ol></li><li><a href="ch13.xhtml#providing-feedback-with-informational-messages">Providing Feedback with Informational Messages</a></li><li><a href="ch13.xhtml#asynchronous-processors">Asynchronous Processors</a></li><li><a href="ch13.xhtml#externalizing-batch-process-execution">Externalizing Batch Process Execution</a><ol><li><a href="ch13.xhtml#remote-chunking">Remote Chunking</a></li><li><a href="ch13.xhtml#remote-partitioning">Remote Partitioning</a></li></ol></li></ol></li></ol></li><li><a href="apa.xhtml">A. List of ItemReaders and ItemWriters</a><ol><li><a href="apa.xhtml#itemReadersAppendix">Item Readers</a></li><li><a href="apas02.xhtml">Item Writers</a></li></ol></li><li><a href="apb.xhtml">B. Meta-Data Schema</a><ol><li><a href="apb.xhtml#metaDataSchemaOverview">Overview</a><ol><li><a href="apb.xhtml#exampleDDLScripts">Example DDL Scripts</a></li><li><a href="apb.xhtml#metaDataVersion">Version</a></li><li><a href="apb.xhtml#metaDataIdentity">Identity</a></li></ol></li><li><a href="apbs02.xhtml">BATCH_JOB_INSTANCE</a></li><li><a href="apbs03.xhtml">BATCH_JOB_EXECUTION_PARAMS</a></li><li><a href="apbs04.xhtml">BATCH_JOB_EXECUTION</a></li><li><a href="apbs05.xhtml">BATCH_STEP_EXECUTION</a></li><li><a href="apbs06.xhtml">BATCH_JOB_EXECUTION_CONTEXT</a></li><li><a href="apbs07.xhtml">BATCH_STEP_EXECUTION_CONTEXT</a></li><li><a href="apbs08.xhtml">Archiving</a></li><li><a href="apbs09.xhtml">International and Multi-byte Characters</a></li><li><a href="apbs10.xhtml">Recommendations for Indexing Meta Data Tables</a></li></ol></li><li><a href="apc.xhtml">C. Batch Processing and Transactions</a><ol><li><a href="apc.xhtml#transactionsNoRetry">Simple Batching with No Retry</a></li><li><a href="apcs02.xhtml">Simple Stateless Retry</a></li><li><a href="apcs03.xhtml">Typical Repeat-Retry Pattern</a></li><li><a href="apcs04.xhtml">Asynchronous Chunk Processing</a></li><li><a href="apcs05.xhtml">Asynchronous Item Processing</a></li><li><a href="apcs06.xhtml">Interactions Between Batching and Transaction Propagation</a></li><li><a href="apcs07.xhtml">Special Case: Transactions with Orthogonal Resources</a></li><li><a href="apcs08.xhtml">Stateless Retry Cannot Recover</a></li></ol></li><li><a href="go01.xhtml">Glossary</a></li></ol></nav></div><footer/></body></html> |