最近因为工作需要抽空学习了一下Spring Batch,本次学习基于Spring Batch2.1.8。
Spring Batch是一个进行批处理的框架,系统中可能会有需要在后台执行的不需要人工干预的任务处理要求,比如说定时计算报表数据,定时抽取数据等。
先来看Spring Batch官方给出的两张图:
从图中可以看到Spring Batch被划分为三个模块,Application,Core,Infrastructure,这三个模块的定义是这样的:
The Infrastructure provides the ability to batch operations together, and to retry an piece of work if there is an exception.
The Core module is the batch-focused domain and implementation.
The Application module is focused on the business logic.
从三个模块的定义可以看出三个模块分别的关注点,Infrastructure 提供了一些基础服务,Core提供了批处理领域相关的模型,Application则主要关注业务处理逻辑。平常对于使用Spring Batch主要在Application模块。
Core模块专注于批处理领域,它的设计采用了Domain-Driven Design,极大的简化了理解的难度。最后设计出来的领域模型如下图:
A Job has one to many steps, which has exactly one ItemReader, ItemProcessor, and ItemWriter. A job needs to be launched (JobLauncher), and meta data about the currently running process needs to be stored (JobRepository).
下面是JOB相关的几个概念的类图
从中可以看到一个JobInstance = Job + JobParameters,即表示Job运行时的一种状态,如图所示。
对应的表结构如下,这里只是列举一些表明关系的字段。
总体表结构
http://blog.csdn.net/rudyone/article/details/7204644
分享到:
相关推荐
Spring Batch 是一个轻量级的、完善的批处理框架,旨在帮助企业建立健壮、高效的批处理应用。Spring Batch是Spring的一个子项目,使用Java语言并基于Spring框架为基础开发,使得已经使用 Spring 框架的开发者或者企业更...
Spring Boot整合Spring Batch的一个小例子,在网上发现这方面的资源比较少,特此将其上传供大家学习。
Spring Batch API(Spring Batch 开发文档).CHM。 官网 Spring Batch API,Spring Batch 开发文档
spring-batch4.0.0 batch spring-batch集成 spring-batch.jar
Spring Batch是一个轻量级的,完全面向Spring的批处理框架,可以应用于企业级大量的数据处理系统。Spring Batch以POJO和大家熟知的Spring框架为基础,使开发者更容易的访问和利用企业级服务。Spring Batch可以提供...
spring batch批处理框架和对应的源码资源 rar 可以直接运行的
最近在研究springBoot+springbatch ,按照官网的实例做了一个实例。 最近在研究springBoot+springbatch ,按照官网的实例做了一个实例。
Work with all aspects of batch processing in a modern Java environment using a selection of Spring frameworks. This book provides up-to-date examples using the latest configuration techniques based on...
基于Spring Batch的大数据量并行处理 基于Spring Batch的大数据量并行处理
mybatis、springBatch、mysql、quartz、spring、springMVC 部署说明: 本项目为两个数据库,由一个数据库的表向另外一个数据库的表做数据迁移,其中数据库脚本在:/src/main/resources/sql/下面(其中data_rep中的表...
主要给大家介绍了Spring Batch读取txt文件并写入数据库的方法,SpringBatch 是一个轻量级、全面的批处理框架。这里我们用它来实现文件的读取并将读取的结果作处理,处理之后再写入数据库中的功能。需要的朋友可以...
Spring Batch in Action is a comprehensive, in-depth guide to writing batch applications using Spring Batch. Written for developers who have basic knowledge of Java and the Spring lightweight ...
Spring Batch 是一个轻量级、全面的批处理框架,旨在开发对企业系统日常运营至关重要的强大批处理应用程序。Spring Batch 建立在人们从 Spring Framework 中了解到的生产力、基于 POJO 的开发方法和一般易用性功能之...
难得的详细spring batch资料 难得的详细spring batch资料
Spring batch in action,很好的一本书。
Spring Batch批处理框架Spring Batch批处理框架Spring Batch批处理框架
SpringBatch数据库建表语句,存储springBatch批处理过程中需要保存的数据和步骤信息
springbatch mybatis
2,什么是 Spring Batch 3 二,Spring Batch结构 4 1,Spring Batch体系结构 4 2,Spring Batch主要对象 5 三,Spring Batch流程介绍 5 四,Spring Batch之Step执行过程介绍 6 五,Spring Batch应用 7 1,简单应用 7...
资源名称:Spring Batch 批处理框架内容简介:《Spring Batch 批处理框架》全面、系统地介绍了批处理框架Spring Batch,通过详尽的实战示例向读者展示了Spring Batch框架对大数据批处理的基本开发能力,并对框架的...