{"id":18888938,"url":"https://github.com/naver/spring-batch-plus","last_synced_at":"2025-04-05T02:08:45.213Z","repository":{"id":62345380,"uuid":"558165952","full_name":"naver/spring-batch-plus","owner":"naver","description":"Add useful features to spring batch","archived":false,"fork":false,"pushed_at":"2025-03-23T08:36:00.000Z","size":1098,"stargazers_count":121,"open_issues_count":1,"forks_count":10,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-29T01:09:14.763Z","etag":null,"topics":["dsl","java","kotlin","kotlin-dsl","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naver.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-10-27T02:33:44.000Z","updated_at":"2025-03-23T08:36:03.000Z","dependencies_parsed_at":"2023-02-14T06:46:04.074Z","dependency_job_id":"ad7684a4-53ab-462b-aed9-37ab09b20921","html_url":"https://github.com/naver/spring-batch-plus","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Fspring-batch-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Fspring-batch-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Fspring-batch-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Fspring-batch-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naver","download_url":"https://codeload.github.com/naver/spring-batch-plus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276164,"owners_count":20912288,"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":["dsl","java","kotlin","kotlin-dsl","spring-batch"],"created_at":"2024-11-08T07:46:41.109Z","updated_at":"2025-04-05T02:08:45.190Z","avatar_url":"https://github.com/naver.png","language":"Kotlin","readme":"# Spring Batch Plus\n\n![maven central version](https://maven-badges.herokuapp.com/maven-central/com.navercorp.spring/spring-batch-plus-kotlin/badge.svg)\n[![build](https://github.com/naver/spring-batch-plus/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/naver/spring-batch-plus/actions/workflows/build.yml?query=branch%3Amain)\n[![coverage](https://codecov.io/github/naver/spring-batch-plus/branch/main/graph/badge.svg)](https://codecov.io/github/naver/spring-batch-plus)\n[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/naver/spring-batch-plus/blob/main/LICENSE)\n\nSpring Batch Plus provides extension features to [Spring Batch](https://github.com/spring-projects/spring-batch).\n\n## Features\n\n### Kotlin DSL\n\n```kotlin\n@Bean\nfun testJob(batch: BatchDsl): Job = batch {\n    job(\"testJob\") {\n        step(\"jobStep1\") {\n            jobBean(\"subJob1\")\n        }\n        step(\"jobStep2\") {\n            jobBean(\"subJob2\")\n        }\n    }\n}\n\n@Bean\nfun subJob1(batch: BatchDsl, transactionManager: PlatformTransactionManager): Job = batch {\n    job(\"subJob1\") {\n        step(\"testStep1\") {\n            tasklet({ _, _ -\u003e RepeatStatus.FINISHED }, transactionManager)\n        }\n    }\n}\n\n@Bean\nfun subJob2(batch: BatchDsl, transactionManager: PlatformTransactionManager): Job = batch {\n    job(\"subJob2\") {\n        step(\"testStep2\") {\n            tasklet({ _, _ -\u003e RepeatStatus.FINISHED }, transactionManager)\n        }\n    }\n}\n```\n\n### Single class reader-processor-writer\n\n- ItemStreamFluxReaderProcessorWriter\n- ItemStreamIterableReaderProcessorWriter\n- ItemStreamIterableReaderProcessorWriter\n- ItemStreamSimpleReaderProcessorWriter\n\n```kotlin\n// single class\n@Component\n@StepScope\nclass SampleTasklet : ItemStreamFluxReaderProcessorWriter\u003cInt, String\u003e {\n    private var count = 0\n\n    override fun readFlux(executionContext: ExecutionContext): Flux\u003cout Int\u003e {\n        return Flux.generate { sink -\u003e\n            if (count \u003c 20) {\n                sink.next(count)\n                ++count\n            } else {\n                sink.complete()\n            }\n        }\n    }\n\n    override fun process(item: Int): String? {\n        return \"'$item'\"\n    }\n\n    override fun write(chunk: Chunk\u003cString\u003e) {\n        println(chunk.items)\n    }\n}\n\n// usage\n@Bean\nfun testJob(\n    sampleTasklet: SampleTasklet,\n    batch: BatchDsl,\n): Job = batch {\n    job(\"testJob\") {\n        step(\"testStep\") {\n            chunk\u003cInt, String\u003e(3, ResourcelessTransactionManager()) {\n                reader(sampleTasklet.asItemStreamReader())\n                processor(sampleTasklet.asItemProcessor())\n                writer(sampleTasklet.asItemStreamWriter())\n            }\n        }\n    }\n}\n```\n\n### Other Useful Classes\n\n- ClearRunIdIncrementer\n- DeleteMetadataJob\n\n## Compatibility\n\nWe've tested following versions only. Other versions may not work.\n\n| Batch Plus (Latest) | Batch | Boot Starter  | Kotlin        | Java          | Status     | Samples                                                                                    |\n|---------------------|-------|---------------|---------------|---------------|------------|--------------------------------------------------------------------------------------------|\n| 1.2.x (1.2.0)       | 5.2.x | 3.4.x ~ 3.4.x | 1.6 or higher | 17 or higher  | Maintained | [Samples](https://github.com/naver/spring-batch-plus/tree/main/spring-batch-plus-sample)   |\n| 1.1.x (1.1.0)       | 5.1.x | 3.2.x ~ 3.3.x | 1.5 or higher | 17 or higher  | Maintained | [Samples](https://github.com/naver/spring-batch-plus/tree/1.1.x/spring-batch-plus-sample)  |\n| 1.0.x (1.0.1)       | 5.0.x | 3.0.x ~ 3.1.x | 1.5 or higher | 17 or higher  | Maintained | [Samples](https://github.com/naver/spring-batch-plus/tree/1.0.x/spring-batch-plus-sample)  |\n| 0.3.x (0.3.1)       | 4.3.x | 2.4.x ~ 2.7.x | 1.5 or higher | 1.8 or higher | Maintained | [Samples](https://github.com/naver/spring-batch-plus/tree/0.3.x/spring-batch-plus-sample)  |\n| 0.2.x (0.2.0)       | 4.3.x | 2.4.x ~ 2.7.x | 1.5 or higher | 1.8 or higher | Freezed    | [Samples](https://github.com/naver/spring-batch-plus/tree/v0.2.0/spring-batch-plus-sample) |\n| 0.1.x (0.1.0)       | 4.3.x | 2.4.x ~ 2.7.x | 1.5 or higher | 1.8 or higher | Freezed    | [Samples](https://github.com/naver/spring-batch-plus/tree/v0.1.0/spring-batch-plus-sample) |\n\n## Download\n\nSince it provides extension features to spring batch, need to used with [spring batch](https://github.com/spring-projects/spring-batch).\n\n### Gradle\n\nKotlin\n\n```kotlin\nimplementation(\"org.springframework.boot:spring-boot-starter-batch:${springBootVersion}\") // need spring batch\nimplementation(\"com.navercorp.spring:spring-boot-starter-batch-plus-kotlin:${springBatchPlusVersion}\")\n```\n\nJava\n\n```kotlin\nimplementation(\"org.springframework.boot:spring-boot-starter-batch:${springBootVersion}\") // need spring batch\nimplementation(\"com.navercorp.spring:spring-boot-starter-batch-plus:${springBatchPlusVersion}\")\n```\n\n### Maven\n\nKotlin\n\n```xml\n\u003c!-- need spring batch --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-starter-batch\u003c/artifactId\u003e\n    \u003cversion\u003e{springBootVersion}\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.navercorp.spring\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-starter-batch-plus-kotlin\u003c/artifactId\u003e\n    \u003cversion\u003e{springBatchPlusVersion}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nJava\n\n```xml\n\u003c!-- need spring batch --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-starter-batch\u003c/artifactId\u003e\n    \u003cversion\u003e{springBootVersion}\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.navercorp.spring\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-starter-batch-plus\u003c/artifactId\u003e\n    \u003cversion\u003e{springBatchPlusVersion}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## User Guide\n\n- 1.2.x\n    - [Korean](https://github.com/naver/spring-batch-plus/tree/main/doc/ko)\n    - [English](https://github.com/naver/spring-batch-plus/tree/main/doc/en)\n- 1.1.x\n    - [Korean](https://github.com/naver/spring-batch-plus/tree/1.1.x/doc/ko)\n    - [English](https://github.com/naver/spring-batch-plus/tree/1.1.x/doc/en)\n- 1.0.x\n    - [Korean](https://github.com/naver/spring-batch-plus/tree/1.0.x/doc/ko)\n    - [English](https://github.com/naver/spring-batch-plus/tree/1.0.x/doc/en)\n- 0.3.x\n    - [Korean](https://github.com/naver/spring-batch-plus/tree/0.3.x/doc/ko)\n    - [English](https://github.com/naver/spring-batch-plus/tree/0.3.x/doc/en)\n\n## Build from source\n\n### Prerequisites\n\n- Jdk 17 or higher\n\n### Build\n\n- Clean: `./gradlew clean`\n- Check: `./gradlew check`\n    - Coverage report will be generated in `${project}/build/jacoco/html/index.html`\n- Assemble: `./gradlew build`\n- Install to local: `./gradlew install`\n- Publish: `./gradlew publish --no-parallel`\n\n## License\n\n```\n   Copyright (c) 2022-present NAVER Corp.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n```\n","funding_links":[],"categories":["批处理框架"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaver%2Fspring-batch-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaver%2Fspring-batch-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaver%2Fspring-batch-plus/lists"}