Introduction of single-step-batch-job sample

resolves #702
This commit is contained in:
Glenn Renfro
2020-08-07 18:05:56 -04:00
committed by Michael Minella
parent b71b46c333
commit 414cfc3e96
18 changed files with 797 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
/*
* Copyright 2020-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.spring;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.task.configuration.EnableTask;
@EnableTask
@SpringBootApplication
@EnableBatchProcessing
public class SingleStepBatchJobApplication {
public static void main(String[] args) {
SpringApplication.run(SingleStepBatchJobApplication.class, args);
}
}

View File

@@ -0,0 +1,9 @@
spring.batch.job.flatfilereader.savestate=true
spring.batch.job.flatfilereader.name=fixedWidthConfiguration
spring.batch.job.flatfilereader.comments=#,$
spring.batch.job.flatfilereader.resource=/test.txt
spring.batch.job.flatfilereader.strict=true
spring.batch.job.flatfilereader.fixedLength=true
spring.batch.job.flatfilereader.ranges=1-3
spring.batch.job.flatfilereader.names=ITEM_NAME
spring.batch.job.flatfilereader.parsingStrict=false

View File

@@ -0,0 +1,11 @@
spring.batch.job.flatfilewriter.name=fooWriter
spring.batch.job.flatfilewriter.resource=file:result.txt
spring.batch.job.flatfilewriter.encoding=UTF-16
spring.batch.job.flatfilewriter.saveState=false
spring.batch.job.flatfilewriter.shouldDeleteIfEmpty=true
spring.batch.job.flatfilewriter.delimited=true
spring.batch.job.flatfilewriter.names=ITEM_NAME
spring.batch.job.flatfilewriter.append=true
spring.batch.job.flatfilewriter.forceSync=true
spring.batch.job.flatfilewriter.shouldDeleteIfExists=false
spring.batch.job.flatfilewriter.transactional=false

View File

@@ -0,0 +1,2 @@
spring.batch.job.jdbccursorreader.name=fooReader
spring.batch.job.jdbccursorreader.sql=select item_name from item_sample order by item_name

View File

@@ -0,0 +1,2 @@
spring.batch.job.jdbcwriter.name=jdbcWriter
spring.batch.job.jdbcwriter.sql=INSERT INTO item (item_name) VALUES (:ITEM_NAME)

View File

@@ -0,0 +1,4 @@
spring.application.name=Single Step Batch Job
spring.batch.job.jobName=job
spring.batch.job.stepName=step1
spring.batch.job.chunkSize=5

View File

@@ -0,0 +1,6 @@
foo
bar
baz
qux
boo
Job