How to use Spring Batch Late Binding – Step Scope & Job Scope
springbatch
9
springboot
138
job-scope
1
Male avatar

loveprogramming viết ngày 26/04/2021

https://grokonez.com/spring-framework/spring-batch/use-spring-batch-late-binding-step-scope-job-scope

How to use Spring Batch Late Binding – Step Scope & Job Scope

Spring Batch Late Binding provides a solution for late binding Job's Parameters with Beans' properties. In the tutorial, JavaSampleApproach will introduce Spring Batch Late Binding cleary by a sample project.

Related Articles:

  1. How to use Spring Batch Inheritance function
  2. How to use Intercepting Job Execution in Spring Batch
  3. How to start with Spring Batch using Spring Boot – Java Config
  4. Spring Batch Partition for Scaling & Parallel Processing

I. Spring Batch Late Binding

See below configuration:

<!-- Abstract Parent Bean -->
<beans:bean id="parentBean" abstract="true">
    <beans:property name="folder" value="${folder}"/>
    <beans:property name="fileName" value="${inputFileName}"/>
</beans:bean> 

The configuration uses a traditional approach:${folder} & ${inputFileName}
folder & inputFileName must define in a configuration file, like application.properties:


folder=C:\\readfile
inputFileName=1.txt

Question: How to bind data between Job Parameters & Beans' properties?
Answer: Spring Batch Late Binding with Job & Step attributes.

1. Step Scope

Spring Batch provides various form for late binding with Step attributes:

https://grokonez.com/spring-framework/spring-batch/use-spring-batch-late-binding-step-scope-job-scope

How to use Spring Batch Late Binding – Step Scope & Job Scope

Bình luận


White
{{ comment.user.name }}
Bỏ hay Hay
{{comment.like_count}}
Male avatar
{{ comment_error }}
Hủy
   

Hiển thị thử

Chỉnh sửa

Male avatar

loveprogramming

451 bài viết.
79 người follow
Kipalog
{{userFollowed ? 'Following' : 'Follow'}}
Cùng một tác giả
Male avatar
1 0
Tutorial Link: (Link) (Ảnh) Django is a Pythonbased free and opensource web framework that follows the modeltemplateview architectural pattern. A...
loveprogramming viết 6 tháng trước
1 0
Male avatar
1 0
https://loizenai.com/angular11nodejspostgresqlcrudexample/ Angular 11 Node.js PostgreSQL Crud Example (Ảnh) Tutorial: “Angular 11 Node.js Postg...
loveprogramming viết 5 tháng trước
1 0
Male avatar
1 0
Angular Spring Boot jwt Authentication Example Github https://loizenai.com/angularspringbootjwt/ (Ảnh) Tutorial: ” Angular Spring Boot jwt Authe...
loveprogramming viết 5 tháng trước
1 0
Bài viết liên quan
Male avatar
0 0
https://grokonez.com/frontend/angular/angular6/kotlinspringbootangular6crudhttpclientmysqlexamplespringdatajparestapisexample Kotlin Spring Boot +...
loveprogramming viết 1 tháng trước
0 0
{{like_count}}

kipalog

{{ comment_count }}

bình luận

{{liked ? "Đã kipalog" : "Kipalog"}}


Male avatar
{{userFollowed ? 'Following' : 'Follow'}}
451 bài viết.
79 người follow

 Đầu mục bài viết

Vẫn còn nữa! x

Kipalog vẫn còn rất nhiều bài viết hay và chủ đề thú vị chờ bạn khám phá!