Bạn có chắc chắn muốn xóa bài viết này không ?
Bạn có chắc chắn muốn xóa bình luận này không ?
How to 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:
- How to use Spring Batch Inheritance function
- How to use Intercepting Job Execution in Spring Batch
- How to start with Spring Batch using Spring Boot – Java Config
- 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:
How to use Spring Batch Late Binding – Step Scope & Job Scope






