{"id":18861256,"url":"https://github.com/simplydemo/spring-batch-demo","last_synced_at":"2026-05-03T05:31:16.000Z","repository":{"id":76282561,"uuid":"479274741","full_name":"simplydemo/spring-batch-demo","owner":"simplydemo","description":"spring-batch demo by kotlin","archived":false,"fork":false,"pushed_at":"2022-04-08T13:47:06.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T20:28:04.323Z","etag":null,"topics":["jpa","junit-jupiter","kotlin","maven","spring-batch"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simplydemo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-08T06:39:56.000Z","updated_at":"2022-06-02T01:38:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"9d66dc28-9fbd-4895-a947-980d14c4c32c","html_url":"https://github.com/simplydemo/spring-batch-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplydemo%2Fspring-batch-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplydemo%2Fspring-batch-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplydemo%2Fspring-batch-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplydemo%2Fspring-batch-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplydemo","download_url":"https://codeload.github.com/simplydemo/spring-batch-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239800522,"owners_count":19699154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jpa","junit-jupiter","kotlin","maven","spring-batch"],"created_at":"2024-11-08T04:28:51.852Z","updated_at":"2026-02-09T09:30:17.342Z","avatar_url":"https://github.com/simplydemo.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spring-batch-demo\n\n## Checkout\n```\ngit clone https://github.com/chiwoo-samples/spring-batch-demo.git\n\n# for intellij\n# idea spring-batch-demo\n```\n\n## Build\n```\n./mvnw clean package -DskipTests=true\n```\n\n## Run\n```\njava -jar target/spring-batch-demo-0.0.1-SNAPSHOT.jar --job.names=helloFirstJob\njava -jar target/spring-batch-demo-0.0.1-SNAPSHOT.jar --job.names=helloSecondJob\njava -jar target/spring-batch-demo-0.0.1-SNAPSHOT.jar --job.names=helloSequentialJob\njava -jar target/spring-batch-demo-0.0.1-SNAPSHOT.jar --job.names=helloConditionalJob -processorNo=2\njava -jar target/spring-batch-demo-0.0.1-SNAPSHOT.jar --job.names=helloFirstJob,helloSecondJob,helloSequentialJob\n```\n\n## Use Cases\n\n### Hello First\nHelloFirstJob 는 \"Hello World!\" 문자열을 출력하는 가장 단순한 배치 프로세스 입니다.\n- [HelloFirstJob](./src/main/kotlin/example/chiwoo/demo/jobs/hello01/HelloFirstJobConfig.kt) 배치 잡 정의  \n- [Hello01JobTest.kt](./src/test/kotlin/example/chiwoo/demo/jobs/Hello01JobTest.kt) 단위 테스트\n- 콘솔에서 실행\n```\njava -jar target/spring-batch-demo-0.0.1-SNAPSHOT.jar --job.names=helloFirstJob\n```\n\n### Hello Second\nHelloSecondJob 는 reader -\u003e processor -\u003e writer 로 역할이 분리된 가장 기본적인 Tasklet 으로 chunk-size 단위로 배치 프로세스를 실행 합니다. \n- [HelloSecondJobConfig.kt](./src/main/kotlin/example/chiwoo/demo/jobs/hello02/HelloSecondJobConfig.kt) 배치 잡 정의\n- [Hello02JobTest.kt](./src/test/kotlin/example/chiwoo/demo/jobs/Hello02JobTest.kt) 단위 테스트\n- 콘솔에서 실행\n```\njava -jar target/spring-batch-demo-0.0.1-SNAPSHOT.jar --job.names=helloSecondJob\n```\n\n### Hello Listener\nHelloListenerJobConfig 는 Job, StepExecution, Chunk 에 대해 각각 리스너를 추가 하고 배치 프로세서 실행시 각 리스너의 pre / post 프로세스를 통해 공통 작업을 지원할 수 있습니다.       \n- [HelloListenerJobConfig.kt](./src/main/kotlin/example/chiwoo/demo/jobs/hello03/HelloListenerJobConfig.kt) 배치 잡 정의\n- [Hello03ListenerJobTest.kt](./src/test/kotlin/example/chiwoo/demo/jobs/Hello03ListenerJobTest.kt) 단위 테스트\n- 콘솔에서 실행\n```\njava -jar target/spring-batch-demo-0.0.1-SNAPSHOT.jar --job.names=helloListenerJob\n```\n\n### Hello Sequential\nHelloSequentialJobConfig 는 step1 -\u003e step2 -\u003e step3 작업이 순차적으로 실행 합니다.  \n\n- [HelloSequentialJobConfig.kt](./src/main/kotlin/example/chiwoo/demo/jobs/hello04/HelloSequentialJobConfig.kt) 배치 잡 정의\n- [Hello04SequentialJobTest.kt](./src/test/kotlin/example/chiwoo/demo/jobs/Hello04SequentialJobTest.kt) 단위 테스트\n- 콘솔에서 실행\n```\njava -jar target/spring-batch-demo-0.0.1-SNAPSHOT.jar --job.names=helloSequentialJob\n```\n\n### Hello Conditional\nHelloConditionalJobConfig 는 step1 의 작업 처리 결과가 성공인 경우와 실패인 경우에 대해 각각 다른 유형으로 배치 프로세스를 실행 합니다.   \n입력 `answer` 값이 홀수 이면 step1 이 `성공`을, 짝수 이면 `실패`를 반환 합니다.  \n\n```\nCase1) step1 의 처리 결과가 '성공'인 경우\n  step1 -\u003e step2 -\u003estep3 \nCase2) step1 의 처리 결과가 '실패'인 경우\n  step1 -\u003e step4      \n```\n- \n- [HelloConditionalJobConfig.kt](./src/main/kotlin/example/chiwoo/demo/jobs/hello05/HelloConditionalJobConfig.kt) 배치 잡 정의\n- [Hello05ConditionalJobTest.kt](./src/test/kotlin/example/chiwoo/demo/jobs/Hello05ConditionalJobTest.kt) 단위 테스트\n- 콘솔에서 실행\n```\n# 성공 프로세스 실행 예시 \njava -jar target/spring-batch-demo-0.0.1-SNAPSHOT.jar --job.names=helloConditionalJob -answer=1\n\n# 실패 프로세스 실행 예시  \njava -jar target/spring-batch-demo-0.0.1-SNAPSHOT.jar --job.names=helloConditionalJob -answer=2\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplydemo%2Fspring-batch-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplydemo%2Fspring-batch-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplydemo%2Fspring-batch-demo/lists"}